I know how to find files with suffix .txt in the current directory: find *.txt
.txt
find *.txt
How do I invert this?
I am new to Linux, so please help. Thanks!
If you just want the current directory, and your shell is bash:
shopt -s extglob ls !(*.txt)
reference
find ! -name "*.txt"
or
find -not -name "*.txt"
find in current file not recursive
find -maxdepth 1 ! -name "*.txt"
Copyright © 2021 Jogjafile Inc.
If you just want the current directory, and your shell is bash:
reference