If you have recently started with operating systems, and got overwhelmed with the multitude of commands that Linux provides, don't worry! This blog is here to walk you through some basic Linux commands which are easier to grasp as a beginner.
What is Linux?
Linux is the most commonly used server based operating system. Linux is a free and open-source operating system allowing for the customization and redistribution of its code under your name. This feature allows for a high degree of flexibility and adaptability within the platform. There are several Linux Distributions you can call as different variations, commonly called “Distros”.
Ubuntu Linux
Red Hat Enterprise Linux
Linux Mint
Debian
Fedora
Command Line Interface.
If you are also one of those who might have been reluctant to use CLI, thinking it’s for users who are pro. That’s not true.
The command line interface or the Linux Terminal is where you get to type your commands and interact with the server. It is like a program that takes a command from the keyboard and sends the operating system to execute it. It’s a text-based editor which allows the computer to do specific tasks.
It’s recommended to try out these commands on your terminal. Download and install any Linux distribution you wish to and get started. To open the terminal, press Ctrl+Alt+T in Ubuntu. Although, the steps might differ depending on the distro that you are using.
Let's get started with these basic commands.
pwd command
When you first open the terminal, you are in the home directory of your user. To know which directory you are in, you can use the “pwd” command.
ls command
ls command stands for list. Use the “ls” command to know what files are in the directory you are in. You can see all the hidden files by using the command
“ls -a”.
cd command
The cd command stands for change directory. It allows you to change from one directory to another. It allowed me to change my present working directory to a directory named "test".
mkdir command
The mkdir command stands for make directory. The command takes the name of the directory to be created as input.
rmdir command
rmdir command is used to delete a directory. But rmdir can only be used to delete an empty directory. To delete a directory containing files, use rm.
touch command
The touch command is used to create an empty file. For example, “touch tutorial.txt”
cat command
It reads data from the file and displays the content of the file. It helps us to create, view, and concatenate files.
cp command
cp stands for a copy. It is used to copy files and directories in Linux. The first is the location of the file to be copied, the second is where to copy. In this case, if the second file which is file2.txt was not created earlier, the cp command created it for us., and the content is copied. But if the file already existed, then it simply overwrites it.
mv command
mv stands for move. mv is used to move one or more files or directories from one place to another. It is also used for renaming files.
These are just a few of the basic Linux commands that you'll need to know to get started. If you wish to know the writer of this blog, here it goes. I'm an undergraduate student making myself explore more and more of web development. I have been creating content for my community HackForCode for the past six months. I have had the privilege of being selected as a LinkedIn Campus Creator, and I've had so much fun creating content, engaging with communities, and continuously growing my skills. If you need any assistance with content writing, I'm just a DM away. :)
You can connect with me on Twitter || LinkedIn
Stay tuned for Part 2 and Part 3 of this blog. :)