Linked Questions

8 votes
1 answer
981 views

How to find the files recursively having a text pattern excluding some directories and files? Example:- $ ls bower.json bower_components configure results unit-tests so I need ...
nagendra547's user avatar
  • 6,440
0 votes
0 answers
147 views

grep --exclude=\*.{mp3,jpg,pdf,png} -i "size\|log" | cut -c 32-|grep -v name1 |grep -v name2 it's not working for me i want to do something like ls -la | grep --exclude=\*.{mp3,jpg,pdf,png}...
KillRoy27's user avatar
1196 votes
15 answers
837k views

I want to traverse all subdirectories, except the node_modules directory.
TIMEX's user avatar
  • 275k
176 votes
14 answers
174k views

I needed to find all the files that contained a specific string pattern. The first solution that comes to mind is using find piped with xargs grep: find . -iname '*.py' | xargs grep -e 'YOUR_PATTERN' ...
Oli's user avatar
  • 16k
209 votes
6 answers
74k views

Is there a way to exclude certain paths/directories/files when searching a Git repository using git grep? Something similar to the --exclude option in the normal grep command? I need to use git grep ...
Yogeshwer Sharma's user avatar
203 votes
8 answers
394k views

How do I use grep to search the current directory for any and all files containing the string "hello" and display only .h and .cc files?
stackoverflow's user avatar
135 votes
7 answers
95k views

When I want to grep all the html files in some directory, I do the following grep --include="*.html" pattern -R /some/path which works well. The problem is how to grep all the html,htm,php files in ...
tianyapiaozi's user avatar
  • 2,018
65 votes
5 answers
24k views

With the normal grep command there is an --exclude option (covered in detail here: Use grep --exclude/--include syntax to not grep through certain files) that lets you ignore specific files when you ...
machineghost's user avatar
31 votes
21 answers
19k views

I want to check if all of my strings exist in a text file. They could exist on the same line or on different lines. And partial matches should be OK. Like this: ... string1 ... string2 ... string3 ....
codeforester's user avatar
  • 43.8k
34 votes
6 answers
58k views

I've read Use grep --exclude/--include syntax to not grep through certain files but in my CentOS6.4, when I do grep --exclude=*.cmd ckim * -r I see lots of grepped lines from *.cmd files. so it ...
Chan Kim's user avatar
  • 6,149
28 votes
4 answers
62k views

A coworker is trying to use ack (a Perl program) on his Windows machine, having tried it under Linux and decided he definitely wants to use it. He managed to get Strawberry Perl installed on his ...
skiphoppy's user avatar
  • 104k
1 vote
3 answers
14k views

Im trying to look for the text Elapsed time inside a specific log file names vsim.log. Im not familiar with grep, but after some googling I found that grep -r will allow me to do recursively searches ...
dorojevets's user avatar
4 votes
4 answers
7k views

We have a rather large and complex file system and I am trying to generate a list of files containing a particular text string. This should be simple, but I need to exclude the './svn' and './pdv' ...
Colin's user avatar
  • 1,171
1 vote
1 answer
882 views

I wish to grep certain files that only exist below a specific subdirectory. Here, I only want .xml files if they exist below the /bar/ subdirectory: ./file0.xml ./.git/file1a.xml ./.git/bar/file1b....
OnlineCop's user avatar
  • 4,079
0 votes
1 answer
391 views

In bash, grep -r --exclude={*.c,} 'HELLO' // exclude c files grep -r --include={*.c,} 'HELLO' // just same with grep -r 'HELLO' What's the problem?
HyunYoung Go's user avatar

15 30 50 per page