Posts Tagged ‘grep’

grep command in linux

The word grep stands for Globally Regular Expression Print. Using grep command in Linux/Unix, we can search one or more files for lines that contains pattern. Syntax: grep [options] pattern [files] Options: Option Description -b Displays the block number at the beginning of each line. -c Displays the number of matched lines -h Displays the […]

Using grep to locate files

If you give grep two or more files to search, it it includes the name of the file before each line of output. The following command searches for lines cintaining the string “JAVA” in all of the files in the current directory. $grep JAVA * schools : 100 vinod java k2schools k2schools: 110 rajesh java […]

Powered by k2schools