Most frequent Linux tools  – Quick start guide

This quick one minute video demonstrates how to use some of the most frequently used tools in Linux or Mac. The processes are elaborated below as this video does not contain any audio. This quick video is from my Mac. Leave comments or questions at the bottom.

Tools demoed:
 vi
 less
 cat
 grep
 awk
The above video demonstrates the following:
  • How to create a directory called tutorial in Linux – the mkdir command
    mkdir tutorial
  • Navigate into the directory
    cd tutorial/
  • How to get a list of contents in directory
    ls
  • How to create file named file.txt using vi or vim and save it
    vi file.txt

    to open editor, then press ‘i’ to start inserting text and ESC to come out of writing mode; and to save and quit, use ‘:wq’ and ENTER!

  • How to quickly view the file without it hogging the screen permanently using less –
    less file.txt

    and then ‘q’ to exit viewing

  • How to view the file in a manner that it stays on the terminal screen using cat
    cat file.txt
  • How to find the string ‘make’ in the file or every occurrence of this string using grep
    grep make file.txt
  • How to use awk to print only certain strings from a line in the file – basically, we want to print certain strings from a line, so its clever to choose a string that is only in that line and grep it first so that we have the line alone; then pipe (|) it to awk to filter the strings using – In this case, awk prints the 4th, 8th, 9th and 10th string from the grep result as output.
    grep ‘abracadabra’ file.txt | awk ‘{print $4,$8,$9,$10}’
 Screen Shot 2016-06-12 at 13.19.14.png
 
In addition to these tools, there are various other tools used (e.g. sed, tail etc) that come in handy with these tools. Please leave any comments or questions. Thanks for visiting.
Advertisements