Subject: Linux shell tips, was Re: [linux-audio-user] beeps are going to break my ears
From: Paul Winkler (pw_lists_AT_slinkp.com)
Date: Mon Dec 22 2003 - 20:12:25 EET
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)
This archive was generated by hypermail 2b28 : Mon Dec 22 2003 - 20:17:28 EET