How to use “grep” & “vim” , “ which”

     [1]. How to use “grep” command to find text including subdirectories

           grep -rnw '/path/to/somewhere/' -e 'pattern'
  • -r or -R is recursive,
  • -n is line number, and
  • -w stands for match the whole word.
  • -l (lower-case L) can be added to just give the file name of matching files.
     [2]. which command

            which [filename1] [filename2] ...

     [3]. Vim
            
  • x - to delete the unwanted character
  • u - to undo the last the command and U to undo the whole line
  • CTRL-R to redo
  • A - to append text at the end
  • :wq - to save and exit
  • :q! - to trash all changes
  • dw - move the cursor to the beginning of the word to delete that word
  • 2w - to move the cursor two words forward.
  • 3e - to move the cursor to the end of the third word forward.
  • 0 (zero) to move to the start of the line.
  • d2w - which deletes 2 words .. number can be changed for deleting the number of consecutive words like d3w
  • dd to delete the line and 2dd to delete to line .number can be changed for deleting the number of consecutive words

Comments

Popular posts from this blog

Java : Variables Declaring

Install DNF in RHEL/CentOS 7

SQL Self JOIN