37. Finally, Some Other Useful (I Hope!) Examples
- We want to secure a RH Linux box, and we want to find all the pesky 'r-something' utilities:
rpm -q -a | grep '^r'
- We want to fix the indenting in or out in vi, after selecting the appropriate rows
with visual mode (i.e. use the 'v' key):
:s/^/ /
:s/^ //
- We want to get rid of those pesky ^M characters from DOS:
:%s/^V^M//
(The ctrl-v tells the shell that the ctrl-m is a literal, so you end up seeing just:
:%s/^M//
on screen!)
|