Often times I’ll want to grab just one part of a command’s output to use for the input of another command. Sometimes I can use grep to do this, and sometimes grep isn’t quite flexible enough and sed is required. The regular expression required to get sed to do the right thing is often complex on its own, and of course the flags need to be set appropriately. If the data format is in columns, sometimes cut can be simpler.
Master Foo nodded and replied: "When you are hungry, eat; when you are thirsty, drink; when you are tired, sleep."
Master Foo nodded and replied: "When you are hungry, eat; when you are thirsty, drink; when you are tired, sleep."
Upon hearing this, the novice was enlightened.
-- http://catb.org/~esr/writings/unix-koans/shell-tools.html