Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道如何.txt在当前目录中查找带后缀的文件: find *.txt
.txt
find *.txt
我该如何反转这个?
我是Linux新手,所以请帮忙。谢谢!
在当前文件中查找不是递归的
find -maxdepth 1 ! -name "*.txt"
如果你只想要当前目录,而你的 shell 是 bash:
shopt -s extglob ls !(*.txt)
参考
find ! -name "*.txt"
或者
find -not -name "*.txt"