最后活跃于 10 months ago

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

timmy 修订了这个 Gist 10 months ago. 转到此修订

没有任何变更

timmy 修订了这个 Gist 10 months ago. 转到此修订

没有任何变更

timmy 修订了这个 Gist 1 year ago. 转到此修订

1 file changed, 2 insertions

find_python_files_and_display_content.sh(文件已创建)

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