Day 2: Linux For DevOps

Vibhuti JainVibhuti Jain
4 min read

What is Linux

Linux is an operating system which sits in the middle of hardware and user. User can run the application and it takes the commands from the user and translates them to hardware.

Advantages of Linux

  1. Open source and used 91% of the applications on the internet.

  2. Allow multiple users to carry out multiple tasks and come up with powerful shells and multiple flavors.

  3. Provides high security and doesn’t need any anti virus software.

What is Kernel, Shell and Bootloader

  1. Kernel - Kernel is the heart of the Linux, it is responsible for all the major activities of the OS. it consists of all the programs, files and processes required to run the OS. It has separate memory or space to work with the OS, which helps to work wisely between hardware and software without interruption.

  2. Shell - Shell is the program which connects our application to the kernel, like a mediator or gateway through shell commands.

    SOFTWARE —> SHELL —--> KERNEL—-----> HARDWARE

  3. Bootloader - Bootloader is one of the processes of the kernel which starts our operating system. It plays a pivotal role in initiating the system and facilitating the loading of the Linux kernel.

    Example - GRUB (Grand Unified Bootloader).

    Linux has components like shell and kernel. We cannot directly talk to the kernel in Linux. We need shells to talk to the kernel by giving instructions.

    Architecture Of Linux

    linux

    History Of Linux

    1. A popular open-source operating system is Linux. Linux came from unix family which was developed by Linus Torvalds in 1991.

    2. At the time, Torvalds was a computer science student at the University of Helsinki, USA.

    3. The name Linux is a combination of his first name, Linus, and Unix, the operating system that inspired his projects.

    4. Linux is considered one of the most stable, secure and reliable operating systems and is widely used in servers, supercomputers and enterprise environments.

File System In Linux

In Linux/Unix operating system everything is represented as a file including a hardware program, the files are stored in a directory and every directory contain a file with a tree structure. This is called Linux file system.

Root directory is represented by a / (forward slash). It is a top level directory in a Linux.

  1. / - The base of the linux directory is root. Every directory arises from the root directory.

  2. /home - Personal directories for each user account.

  3. /bin - Common binary executables used by all users.

  4. /etc - configuration files.

  5. /var - Variable data files such as logs files are located in the var library.

  6. /usr - The user directory contains applications and files used by users as opposed to application used by the system.

Basic Commands of Linux

  1. whoami - Display the name of the current user.

     $whoami
    

  2. ls - Displays information about files and directories in the current directory.

     $ls
    

  3. pwd - Displays the current working directory.

     $pwd
    

  4. mkdir - Creates a directory.

     $mkdir
    

  5. cd - To navigate between different folders.

     $cd
    

  6. rmdir - Removes empty directories from the directory lists.

     $rmdir filename
    

  7. cp - Copy files from one directory to another.

     $cp
    

  8. mv - Rename and move the files.

     $mv
    

  9. rm - Remove or delete the files.

     $rm filename
    

  10. cat - Display file contents on terminal.

    $cat filename
    

  11. clear - clear terminal.

    $clear
    

  12. touch - Create empty files.

    $touch filename
    

  13. head - Return the specified numbers of lines from the top.

    $head -n
    

  14. tail - Return the specified numbers of lines from the bottom.

    $tail -n
    

  15. comm - Display the common element in two files.

    $comm
    

    Note: Before checking common element in two file we need to sort the files in alphabetical order.

  16. wget - Direct download files from the internet.

    $wget https://www.w3resource.com/python-exercises/pandas/excel/SaleData.xlsx
    

  17. more - more command is used to view the text files in the command prompt, displaying one screen at a time in case the file is large (For example log files).

    $more filename
    

  18. less - Less command is a Linux utility that can be used to read the contents of a text file one page (one screen) at a time.

    $less filename
    

0
Subscribe to my newsletter

Read articles from Vibhuti Jain directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vibhuti Jain
Vibhuti Jain

Hi, I am Vibhuti Jain. A Devops Tools enthusiastic who keens on learning Devops tools and want to contribute my knowledge to build a community and collaborate with them. I have a acquired a knowledge of Linux, Shell Scripting, Python, Git, GitHub, AWS Cloud and ready to learn a lot more new Devops skills which help me build some real life project.