what is the use of command 'grep'?

 

  grep- search one or more files that matches a regular pattern

  Format: grep [options] pattern [filename]

  Eg grep -e root /etc/passwd

  Here it displays the lines that contains the pattern root in the file /etc/passwd

  Eg2: grep –lr root /

  Here it list the files that contains the pattern root in the folder '/' recursively

  • 76 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

what is the command 'ls' used for?

       ls – list directory contents.    ...

for what the command 'tail' is used for?

  tail – print the last 10 lines of the named file.If more than one file is specified...

for what purpose the commad 'du' is used for?

      du- estimates the file space usage.   Format: du [options] [file]...

'cp' command in linux

    cp - copy files and directories.  Format: cp [options] source...

'mv' command in linux

       mv – renames and move files     Format mv...