Vi VimDiff

Usefull vimdiff commands to view diff and merge

October 15, 2008 @ 8:20 am · Filed under Linux

Diffing the files and merging them is one of the very common task we do everyday. Following are few very useful commands to view the diff using vim and merge them using the vimdiff commands instead of copying and pasting from one file to another.

Read the rest of this entry »

Sed Text filtering

Quelques commandes utiles avec Sed:


  • filtrage des commantaires:
  • sed ‘/^#/d;; s/#.*$//’

  • Suppression des lignes vides ou pleine d’espace
  • sed ‘/^[[:space:]]*$/d’

  • Mise en colonnes avec Awk:
  • df -m | awk ‘{printf “%-20s \t %-9s \t %-4s \t %s\n”,$1,$3,$4,$7}’

Memo éditeur de texte VI et VIM

Commandes d’insertion de texte

- i insert insertion avant le curseur
- I insert insertion au début de la ligne
- a append insertion après le curseur
- A append insertion à la fin de la ligne
- o open ouvre une ligne blanche en dessous de la ligne courante
- O open ouvre une ligne blanche au dessus de la ligne courante

Read the rest of this entry »