我正在尝试获取目录中c/h/cc
个文件的列表,但我希望排除文件symlink
。
我使用以下命令列出文件,工作正常。
find . -name *.c -o -name *.h -o -name *.cc
我尝试添加选项-type f
来修剪文件符号链接的列表,但没有运气。基本上我想找到给我列出(.c或.h或.cc文件)和文件类型regular file
。
我的目标是将文件列表保存到cscope.files
并在其上运行cscope
,目前cscope抱怨symlinks
。
谢谢。
答案 0 :(得分:3)
这绝对适合我。你确定你的shell没有扩展你的命令行中的*吗?或者您没有对所有项目应用-type f:
find . -type f -and \( -name "*.c" -o -name "*.h" -o -name "*.cc" \)