最終更新 10 months ago

這段 Bash 指令使用 find 指令在當前目錄(.)及其子目錄中 搜尋所有 .py(Python)檔案,並對每個找到的檔案執行 顯示檔名並輸出其內容。這適用於 快速查看專案中的 Python 檔案,方便 程式碼審查、備份或檢查腳本內容。

timmy revised this gist 10 months ago. Go to revision

No changes

timmy revised this gist 10 months ago. Go to revision

No changes

timmy revised this gist 1 year ago. Go to revision

1 file changed, 2 insertions

find_python_files_and_display_content.sh(file created)

@@ -0,0 +1,2 @@
1 + #!/bin/bash
2 + find . -name "*.py" -exec sh -c 'echo "=== {} ==="; cat "{}"; echo ""' \;
Newer Older