hek*_*ran 6 linux unix find syntax macos
我有一个包含源代码和源代码子目录的项目目录。我想使用 Unix 程序find递归搜索某些扩展名的文件名。findLinux 和 Mac OS X 上的版本表现不同。
# Works in Linux
find . -type f -regex ".*\.\(py\|html\)$"
# Neither of these works in Mac OS X
find . -type f -regex ".*\.\(py\|html\)$"
find . -type f -regex ".*\.(py|html)$"
Run Code Online (Sandbox Code Playgroud)
我如何编写此命令以便它可以在 Mac OS X 上运行(希望也可以在 Linux 上运行)?
| 归档时间: |
|
| 查看次数: |
4779 次 |
| 最近记录: |