Get your hands dirty with Linux.

A quick overview of Linux commands and processes for anyone to start DevOps.

The first question before starting is - what is Linux ?, why Linux and why not Windows?

The answers are simple.

Linux is the most prevalent OS in the DevOps world. All the necessary tools like docker, Jenkins, and Kubernetes have a strong integration with Linux. Understanding Linux will help you to build a strong foundation to work with these tools.

The command line - Linux depends hugely on the command Line, so as the DevOps engineers, hence getting comfortable with the CLI will surely ensure better integration with DevOps practices.

these and a few more properties of Linux like shell scripting, and automation, make a wannabe DevOps engineer empowered with the power of Linux.

Here I am going to share some very useful commands in the CLI with its most brief and effective explanation which can make anyone learn Linux as a prerequisite to learn DevOps.

Before starting let's know what kernel is with bash in the simplest explanation -> kernel is the heart( the center which guides it to work accordingly) of Linux, and bash ( Bourne Again Shell ) is the via media ( the CLI only ) with which a user interacts with the kernel.

  1. man <command name> - provides a user manual kind off information for a command.

  2. ls - provides the list of files/folders in the present working directory.

  3. ls -la - provides the list of files/folders along with all necessary details of it in the present working directory.

  4. pwd - tells you about the present working directory.

  5. mkdir <name> - makes a directory(folder) in pwd.

  6. touch <name.file_extension> - creates an empty file inside the folder/pwd.

  7. nano/vi <name.file_extension> - Opens the empty file inside of a text editor(vi/nano)

  8. cat <name.file_extension> - Shows what is been written inside the file.

  9. mv <present_file_location> <new_file_location> - moves(cut) the file/folder from the present file location to the new file location.

  10. cp <present_file_location> <new_file_location> - copies the file/folder from the present file location to the new file location.

  11. rm <file_name.extension> - deletes completely the file.

  12. cd <folder_name> - helps to change between directories

  13. whoami - tells the user name.

  14. su <username> - switches the user to "username"

  15. sudo apt-get update - "sudo" is meant for the root user- the ultimate user in Linux which can perform all OS functions, sudo can also be called the analogy of "Run as administer" as it provides the present user with root permissions. The command above will update the Linux OS to the latest updates available.

  16. sudo apt-get install <dependancy_name> - This helps in installing a dependency/app like git, docker etc.

  17. Present directory - "./", Home directory - "../", root directory - " ~ "

  18. echo "Hello world" - Prints hello world in CLI

  19. chmod <file_name> - To change the permissions of the file.

Secured Shell Protocol in Linux

Imagine you want to establish a connection with a server and your machine to run a few commands/actions which will run in both environments, you need to implement ssh ( Secured Shell ). Ssh provides the connection with the necessary security.

Implement ssh by running the following command -> sudo ssh -i "PEM file" <the_server_where_it_was_working/aws shell>

Here the '-i "PEM file" ' tells the kernel that the ssh command is going to use the PEM file ( Obtained from the server / aws )

Server Copy Protocol ( SCP )

It helps to copy the server attributes from a server to a local machine and vice versa.

Use it -> sudo scp -i "PEM file" <from_location> <to_location>

The journey of learning Linux for DevOps is lengthy yet interesting and anyone should start learning it as the first step to learn DevOps.

This being an introductory blog on Linux, I am keeping it short. Hope this excites you to read further. Do have a watch on the upcoming parts.

Signing off.....