Top "Grep" questions

grep is a command-line text-search utility originally written for Unix.

How to suppress binary file matching results in grep

When using grep in linux, the result often contains a lot of "binary file XXX matches", which I do not …

linux grep
How to grep for the whole word

I am using the following command to grep stuff in subdirs find . | xargs grep -s 's:text' However, this also …

unix grep
How to remove the lines which appear on file B from another file A?

I have a large file A (consisting of emails), one line for each mail. I also have another file B …

linux shell sed diff grep
Using grep and ls -a commands

Using an ls –a and grep, how would you list the name of all of the files in /usr starting …

linux unix grep command ls
How can I grep hidden files?

I am searching through a Git repository and would like to include the .git folder. grep does not include this …

grep hidden-files dotfiles
How to count occurrences of a word in all the files of a directory?

I’m trying to count a particular word occurrence in a whole directory. Is this possible? Say for example there …

linux unix count find grep
Show filename and line number in grep output

I am trying to search my rails directory using grep. I am looking for a specific word and I want …

awk grep
How can I get `find` to ignore .svn directories?

I often use the find command to search through source code, delete files, whatever. Annoyingly, because Subversion stores duplicates of …

linux find bash grep svn
Grep inside all files created within date range

I am on the Ubuntu OS. I want to grep a word (say XYZ) inside all log files which are …

linux ubuntu find grep date-range
Recursive cat all the files into single file

I have bunch of files sitting in folders like data\A\A\A\json1.json data\A\A\A\json2.…

linux bash unix grep cat