- Linux Shell Scripting Cookbook(Third Edition)
- Clif Flynt Sarath Lakshman Shantanu Tushar
- 63字
- 2021-07-09 19:46:14
Negating arguments
The find command can also exclude things that match a pattern using !:
$ find . ! -name "*.txt" -print
This will match all the files whose names do not end in .txt. The following example shows the result of the command:
$ ls list.txt new.PY new.txt next.jpg test.py $ find . ! -name "*.txt" -print . ./next.jpg ./test.py ./new.PY