Reputation: 51877
I have exactly the same problem as this post.
Only instead of finding all the .txt
files, I want a list of all files that are not .txt
files.
Something like
$ ls -LR | grep -v .java
Which definitely does not do what I want.
Upvotes: 0
Views: 433
Reputation: 290155
Use find
as suggested in that post and negate the -name
condition with !
to have the other way round:
find . -type f ! -name "*.txt"
# ^^^^^^^ ^^^^^^^^^^^^^^^
# just files |
# file names not ending with .txt
Upvotes: 1
Reputation: 8571
Does this work for you?,
ls -lr | grep -E -v "*.txt$"
I tested it on my end and it worked, -E extended grep
Upvotes: 0