Title: Stringing multiple commands together
Time: 5-10 minutes
Purpose: Using a combination of commands to quickly get the results we want or to help us extract more information from the data what we already have.
Introduction:
We have learnt commands like tail
and grep
that allow us to view log files and also to find useful bits of information in our log files respectively. But we could string these commands together by using the |
(pipe) parameter which takes output of one command and feed into the next command e.g. ls | grep log
which would show you all the files and directories with “log” in their names in your current directory.
Activity:
- Pass the output of the
tail
command togrep
and search for a string. - ( Extra ninja points
) with extra parameters can you combine
tail
andgrep
to find out how many errors you are getting per second?