Tuesday, November 11, 2008

Some useful shell tips

When in vi use :split for split view of two files, use Ctrl+W to toggle

for rpm query of only names
rpm -qa --queryformat='%{NAME} \n' | sort -n
or using awk
rpm -qa | awk -F"-[0-9]" '{ print $1}'

for grep with highlight of matched word,
grep --color word file

No comments: