Saturday, April 26, 2014

grep

  •   grep command examples
Search for a given string in a file (case in-sensitive search).
$ grep -i "the" demo_file

Print the matched line, along with the 3 lines after it.
$ grep -A 3 -i "example" demo_text

Search for a given string in all files recursively
  • $ grep -r "linuxcare" *


 
 

Related Posts:

  • jobs   jobs command example Print currently running jobs and their status. Syntax jobs [OPTIONS] [PID] Options: -c --command Print the command name for each process in jobs -g --group Only… Read More
  • hostname   hostname Print or set system name SYNTAX $ hostname With no arguments, `hostname' prints the name of the current host system. With one argument, it sets the current host name to the specified str… Read More
  • history   history command example Linux bash history keeps every command a user typed in the command line terminal into a file named .bash_history. Here is an example of Linux history command with no option running i… Read More
  • head   head command example Output the first part of files, prints the first part (10 lines by default) of each file. SYNTAX head [options]... [file]... Examples Extract the first 85 lines from a file… Read More
  • yum yum command examples To install apache using yum. $ yum install httpd To upgrade apache using yum. $ yum update httpd To uninstall/remove apache using yum. $ yum remove httpd … Read More

0 comments:

Post a Comment