您的位置:首页 > 运维架构 > Linux

linux系统中用一条命令 查找/data目录及子目录下 内容包含 “hello” 的所有文件名称 及 所在行数

2013-03-31 15:27 639 查看
find /data "*" -print|xargs grep -n "hello"

匹配到二进制文件 ./strcpy

./strcpy.c:25: char *s2 = "hello lijing";

匹配到二进制文件 ./a.out

./test2.c~:12: strcpy(str, "hello");

匹配到二进制文件 ./test3

./test1.c~:14: strcpy (str, "hello world");

./test3.c:8: strcpy (str, "hello");

./test2.c:15: strcpy (str, "hello");

匹配到二进制文件 ./test4

./test4.c:6: char a[] = "hello world1";

./test4.c:7: char *p = "hello world2";

./test3.c~:7: strcpy(str, "hello");

./test1.c:16: strcpy (str, "hello world");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐