开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜