Linux shell tips, was Re: [linux-audio-user] beeps are going to break my ears

Paul Winkler pw_lists at slinkp.com
Mon Dec 22 13:12:25 EST 2003


On Mon, Dec 22, 2003 at 06:11:27PM +0100, Maarten de Boer wrote:
> > Thanks for the informations, I managed to find an easy way to look in 
> > the big "man bash" :)
> 
> hmm.. you know that you can search in a man page? type /show[enter]
> and it will look first the first instance of the word show.
> type /[enter], and it will look for the next instance. voila :-)

same thing works in less too (man usually uses less!).
Also works in vi.

My award for the single linux command line tip that I wish I'd known
about years earlier: cd -  (cd followed by a single dash).
It takes you to $OLDPWD.

Another great one is ^foo^bar^ which will repeat the most
recent command but substitute the string "bar" for "foo".  e.g.
pw at kermit pw $ find . -name "*pyc" -exec ls -l {} \; >> stuff_of_interest
pw at kermit pw $ ^pyc^pyo^
find . -name "*pyo" -exec ls -l {} \; >> stuff_of_interest

(Notice that it only does one substitution on the line.)

And while I'm at it, two commands I find REALLY handy
which may not be installed by default:
seq(1) and rename(1).

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's NEGA METABOLIC SCOUTER!
(random hero from isometric.spaceninja.com)



More information about the Linux-audio-user mailing list