开发者

grep - only get the prefix only

开发者 https://www.devze.com 2023-03-20 06:23 出处:网络
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.

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

精彩评论

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