开发者

How can I find files within a directory containing paths to /bin but not shbangs?

开发者 https://www.devze.com 2023-04-06 11:45 出处:网络
I want find all files inside of a directory that make a call to /bin exe开发者_Go百科cutable, but I do not want to include shbangs, like so:

I want find all files inside of a directory that make a call to /bin exe开发者_Go百科cutable, but I do not want to include shbangs, like so:

#!/usr/bin/perl
#!/bin/bash

All other files containing the path should be listed and show the code making the call.


Or with only 2 greps:

grep -r /bin * | grep -Pv '.*?:#!'


Give this a try:

$ grep -H -r '.*' *|grep -v '^#!'|grep /bin/
0

精彩评论

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

关注公众号