Day 2: Basic Linux Commands
Essential Commands for Effective Command-Line Interaction

I'm a passionate DevOps engineer, constantly seeking new knowledge and growth. With a knack for learning on the fly, I thrive on implementing solutions quickly and efficiently to keep up with the ever-evolving tech landscape.
Introduction:
Welcome to my first article on Hashnode! In this documentation-style blog post, I aim to share the valuable knowledge I have gained on some of the most important Linux commands. As a beginner, I understand the challenges of navigating through the Linux terminal, and I hope this article will not only serve as a personal record of my learning journey but also assist readers in their quest to become proficient Linux users.
To Create multiple files.
ubuntu@ip-172-xx-xx-xxx:~$ touch file{1..5}.txt
file1.txt file2.txt file3.txt file4.txt file5.txt
The command "touch file{1..5}.txt" is a powerful and efficient way to create multiple files in Linux.
The "touch" command is used to update the access and modification timestamps of a file. However, when used with a filename that doesn't exist, it creates a new file with that name.
In this specific command, "file{1..5}.txt", we are utilizing brace expansion and numerical range to create multiple files at once.
This command is particularly useful when you need to create a series of files quickly and effortlessly.
To Create a Nested directory.
ubuntu@ip-172-xx-xx-xxx:~$ mkdir -p A/B/C/
The command "mkdir -p A/B/C/" is used to create a directory hierarchy in Linux, where the "-p" option allows for the creation of parent directories as needed.
In this specific command, we are creating a directory structure with three levels: "A" as the top-level directory, "B" as a subdirectory of "A", and "C" as a subdirectory of "B".
By running the command "mkdir -p A/B/C/", you will create the directories "A", "B" inside "A", and "C" inside "B". This is a convenient way to create nested directories without having to create each one individually.
To add a user with Its Home directory.
ubuntu@ip-172-xx-xx-xxx:~$ sudo useradd -m Sameer
- The command "sudo useradd -m <user_name>" is used to create a new user account in Linux with a home directory.
By running the command "sudo useradd -m <user_name>", a new user account will be created with a corresponding home directory. The user will then be able to log in and access their personalized space within the Linux system.
ubuntu@ip-172-xx-xx-xxx:~$ cd /home
ubuntu@ip-172-xx-xx-xxx:/home$ ls
ubuntu@ip-172-xx-xx-xxx:/home$ Sameer Yogik
To uninstall an Application.
ubuntu@ip-172-xx-xx-xxx:~$ sudo apt purge docker.io
The command "sudo apt purge docker.io" is used to completely remove the Docker package from a Linux system or any other application that is specified in the command.
By running the command "sudo apt purge docker.io", the Docker package and its associated configuration files will be removed from the system. This includes removing any Docker-related binaries, libraries, and dependencies, freeing up disk space.
Note that purging Docker removes all Docker-related components, containers, images, and configurations from the system. If you plan to reinstall Docker in the future, you will need to set it up again from scratch.
To find Text or Pattern matching.
ubuntu@ip-172-xx-xx-xxx:~$ grep "hello" example.txt
In this example, the grep command is used with the argument "hello" to specify the pattern to search for, and "example.txt" is the file in which the search is performed.
Conclusion:
In this article, we have explored a selection of important Linux commands that every beginner should master. By documenting my learning journey, I hope to assist others in their quest to become proficient Linux users. Remember, practice is key to gaining confidence and fluency with these commands. Embrace the Linux terminal, experiment with different options, and soon you will find yourself navigating and manipulating files effortlessly.
I look forward to sharing more of my Linux knowledge and experiences in future articles. Stay tuned, and happy learning!

