List files not containing “string”. I know this one is simple, but I always end up using grep -c|grep “:0″|sed
grep -L string filelist
Linux list files only (or directories only)
So I had solved this problem multiple different ways, and always seemed to be foiled by different versions of ls, awk, grep, or whatever else I was using to solve what I think is a pretty simple problem. This is the simplest solution I’ve come up with, it’s great for piping output to whatever else you want.
#ldir list directories
alias ldir=’ls -p | egrep “/”‘
#lfo list files only
alias lfo=’ls -p | egrep -v “/”‘