开发者

grep - only get the prefix only

I know -h suppresses the prefix in grep so I would only get the filename. Is there a way to only get the prefix? I do a find for files and then pass that to grep.

Finally found i开发者_StackOverflowt in the manual... -l looks like it now works


Not a flag, but how about

dirname

 dirname /usr/bin/sort
 /usr/bin
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜