I was wondering if there is a way to ls files in a folder that does not have a given extension? For example, if I have a folder full of .cpp and .h files, and I wanted to see if there are other types of files (such as config files and make files), how do I list or find?
Thanks,
You can use find:
find . -maxdepth 1 ! \( -name "*.cpp" -o -name "*.h" \)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With