Activity: Stringing multiple commands together

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:

  1. Pass the output of the tail command to grep and search for a string.
  2. ( Extra ninja points :ninja_black: ) with extra parameters can you combine tail and grep to find out how many errors you are getting per second?