[Nottingham] newbie Hi!
rogerlight at gmail.com
Thu Jan 5 22:57:31 GMT 2006
> perhaps with the opportunity for anyone to shout up with *minor* additional
> information (minor being. eg, such things as a particularly useful option to
> the command under discussion, *not* involving more than one pipe, or the use
> of sed or awk!)
Command strings with just a single pipe are a good idea. It provides
the possibility of introducing other useful commands at the same time.
For anybody unsure, the pipe (or | key, to the left of the z key on a
UK keyboard, obtained by shift and \) is used to take the output of
one command and send it to another.
Most useful, in my opinion is piping any text output into more. So:
ls -l | more
Takes a file listing and pipes it into the more command, thereby
allowing you to look at a page of output at once rather than it all
scrolling by in one go.
locate .jpg | grep roger
locate searches a database of your filesystem for name matches and
grep returns text matches. So this command has two parts - "locate
.jpg" returns a list of all files that have ".jpg" in the name and
then the second part looks at the output of the first and only returns
lines that contain "roger". Combined, it is effectively the command
for "find all jpeg files in roger's home directory".
How's that as a start?
More information about the Nottingham