If you are looking to extract part of a line, using awk as Andrew mentioned is a good method when the you have fields de-limited by whitespace. If you have a delimited records on some othere character, you can use awk with the -F option. For example to print the third field as delimited by a colon character:
Code:
... |awk -F: '{ print $3 }'
.
Delimited fields can alse be extracted using the cut command, which is lighter weight than awk. You specify the delimiting character with the -d option, and the field number(s) with the -f option. You can do the same as the awk command above with cut like this:
Cut can also extract by character position:
...will print output characters 13-19 of the input line(s).
There are several other options. See the cut manual page for more information.