Category Archives: Manipulate Text

Manipulate Text in Linux

vi and vim commands

Command mode ESC dd delete u undelete y yank (copy to buffer) p/P p before cursor/P after cursor Ctl-g show current line number shft-G end of file n shft-G move to line n /stuff/ search n repeat in same direction … Continue reading

Posted in Linux, Manipulate Text, Uncategorized | Leave a comment

awk – common awk commands.

Find device names “sd” or with major number 4 and device name “tty”. Print the record number NR, plus the major number and minor number. $ awk ‘$2 == “sd”||$1 == 4 && $2 == “tty” { print NR,$1,$2}’ /proc/devices … Continue reading

Posted in Linux, Manipulate Text, Uncategorized | 1 Comment