Posts

Showing posts from September, 2019

Basic Linux Commands

grep [options] pattern [files] -c : This prints only a count of the lines that match a pattern -i : Ignores, case for matching -w : Match whole word grep -i "UNix" <file_Name> grep -v "#" <file_Name >                                         -v  option tells  grep  to invert its output find . -name “*.txt” | grep –i JayZ | grep –vi “remix” grep -n "ERROR" <file_Name>                              returns line # of search pattern grep -wr "ERROR" *                                                -r recursively search for word in subdirectories egrep -wr "one|new" *                                          filter with OR File Handling Touch command to create a file of 0kb size.      touch <file_Name> Vi command to edit a file using vi <fileName> ESC :q! Enter to exit without save ESC :wq Enter  to exit & save Cat command to vi