🌻Basic Linux Commands for DevOps Engineers on AWS EC2 Instance 🌻
Linux is one of the most popular Operating Systems. It is free and open source. Linux was first developed by Linus Torvalds when he was a student at the University of Helsinki, Finland.
Now, let’s get started with some jargon.
The Root Directory represents with a forward slash (/). It is the top-level directory in Linux.
/root. This is the home directory for the root user. Also known as superuser.
/bin. User binaries. Contains all binary executables.
/sbin. System binaries. Just like /bin, /sbin also contains binary executables. This is mostly used by system administrators.
/dev. Device files. Contains hardware device files. These include and USB or devices attached to the system.
/var. Variables Files. The variable data files are located in the /var directory.
/mnt. Mount Directory. This directory is used to mount a file system temporarily.
/usr. User Binaries. It contains applications and files used by users.
/etc. Configuration files. It contains all configuration files of the server.
/boot. Boot Loader Files. This directory contains all the files needed to boot the system.
/home. Home Directory. It contains secondary users home directory
/tmp. Temporary files. It contains temporary files created by the system and users.
Next , let’s get to some basic commands widely used by all DevOps engineers in their day-to-day activity
#pwd -> It shows the present working directory
#ls -> It shows available files and directory list in the present working directory
#uname-> It shows the name of the kernel (OS)
#cd-> It is used to change the directory
#clear -> It is used to clear the screen
#whoami -> It shows the current login username
#history -> It shows a list of previously used commands
#date-> It shows the time and date
#mkdir -> To create a file or directory
#touch -> To create a file
We will now log into aws.amazon.com and create an EC2 Ubuntu Instance. If you have never worked on aws prior to this, please create an account. So, rather than installing a Virtual Box, we can rent the server from AWS and once finished, terminate the instance. You are only charged for the amount of consumption. Kindly note that it is essential to terminate the instance after finishing so that you do not continue to be charged. After creating an account, go to Instances and Launch an Instance.
Select the OS as Ubuntu,
Select T2 Micro which is the free tier, and create a new key pair login. Name the key pair as Linux-key and hit on create key pair.
In the Firewall settings, enable HTTP and HTTPS traffic. It should look like this
And finally click on Launch an Instance. Your EC2 instance will be ready.
Once your instance is in running state, you can go and connect to your EC2 instance in the Browser itself.
Now, we will be looking at the black screen which is known as the Shell. The shell commands will goto Kernel.
The DevOps engineer will be working extensively with this black screen also known as the Terminal.
Hope you enjoyed this article and how easy it is to set up an EC2 Instance with Ubuntu Image to practice Linux Commands. If you liked this article, please give your claps. Thank you! 🙏