OS X Bash list files excluding items from input file
I need to list the contents of a directory, but exclude a list of known files which are in a plain text file. I'm assuming using grep or input re开发者_如何转开发direction or possibly a while loop but am stuck.
The following works but is long winded:
ls ~/Library/Fonts | grep -v 'Onyx\|Playbill\|Georgia\|Garamond\|Tahoma\|Verdana\|Microsoft'
Any help appreciated.
ls | grep -v -F -f exclude.file
grep man page
精彩评论