Here is a cool example
Say you type df:
The output would be something like:
[quote:3bb8d51437]Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda2 1712432 1206664 418780 75% /
/dev/hda1 31201 10505 19085 36% /boot
none 30932 0 30932 0% /dev/shm
[/quote:3bb8d51437]
Say you want the second line only you could pipe the output of df to sed
(replace the 2 in '2p' to retrieve a different line)
[code:1:3bb8d51437] df | sed -n '2p'[/code:1:3bb8d51437]
This will return only the second line:
[quote:3bb8d51437]/dev/hda2 1712432 1206664 418780 75% /[/quote:3bb8d51437]
As you can see sed can be very powerful and this is just the beginning of what it can do
sed, matching, retrieving, linessed, lineshere, df, output, bb, filesystem, mounted, dev, hda, shm, retrieve,