Linux has a big impact on our lives. At the very least, your Android phone has a Linux kernel on it. However, starting Linux for the first time will only make you feel uncomfortable. Because on Linux, you should usually use terminal commands instead of just clicking on the launcher image (just like you do on Windows). But don't worry, the 10 basic Linux commands and important commands described below will help you get started as soon as possible.
When we talk about Linux commands, we are talking about the Linux system itself. Just a few 10 basic Linux commands won't make you a genius or Linux expert. It will help Linux novice use these basic Linux commands or Linux common commands to handle routine basic tasks.
OK, here are some of the 10 basic Linux commands.
1.sudo
This superuserdo is the most important command for Linux novices to use. This sudo command is required for each command that requires root permissions. You can use sudo before each command that requires root permissions.
- $ sudo su
2.ls (list)
Just like everyone else, you often want to see everything in the directory. With the list command, the terminal displays all the files and folders in the directory that you are working on. Suppose I am in the/home folder and want to see the directories and files inside/home.
- /home$ ls
LS in/home returns the following results:
- Imad Lost+found
3.cd
The Change directory (CD) is the primary command that is always used in the terminal. It is one of the most basic Linux commands. Using this command is simple. Just enter the name of the folder you want to enter from the current directory. If you want to return to the previous level, simply (..) the double dot As a parameter.
Suppose I am in the/home directory and want to enter the USR directory that is always in/home. Here's how I can use the CD command:
- /home $ cd usr
- /HOME/USR $
4.mkdir
Just changing the directory is not comprehensive. Sometimes, you want to create a new folder or subfolder. You can use the mkdir command to do this. Just place your folder name behind the mkdir command in the terminal.
- ~$ mkdir FolderName
5.cp
Copy-and-paste is an important task that we need to accomplish to organize our files. Using CP will help you copy and paste files from the terminal. First, you can paste the file by identifying the file you want to copy and then entering the destination location.
- $ cp src des
Note : If you copy a file to any new file that requires a directory of root permissions, you will need to use the sudo command.
6.rm
RM This command can remove your files and even remove your directory. If the file requires root permissions to remove it, you can use-f. You can also remove your folders by using-R to recursively remove them.
- $ RM myfile.txt
7.apt-get
For different distributions, this command varies. In a Debian-based Linux distribution, to install, remove, and upgrade any package, we can use the Advanced packaging Tools (APT) package Manager. The Apt-get command can help you install software that needs to run on Linux. This is a powerful command-line tool that can perform tasks such as installing, upgrading, or even removing software.
In other distributions, such as Fedora and CentOS, there are different package managers. Fedora used to have Yum, but now it has DNF.
- $ sudo apt-get update
- $ sudo DNF update
8.grep
You need to find a file, but you cannot remember its exact location or path. grep can help you solve this problem. You can use the grep command to help find a file based on the given keyword.
- $ grep user/etc/passwd
9.cat
As a user, you often need to see some documentation or code from the script. Similarly, one of the Linux basic commands is the Cat command. It will show you the text inside the file.
- $ cat CMakeLists.txt
10.poweroff
The last command is Poweroff. Sometimes you need to shut down directly from the terminal. This command will do the job. Don't forget to add sudo at the beginning of the command, because it requires root permissions to execute poweroff.
- $ sudo poweroff
Conclusion
As I mentioned at the beginning of the article: these 10 basic Linux commands do not immediately turn you into a Linux geek. It will help you start using Linux at this early stage. With these basic Linux commands, start using Linux and set a goal: learn to use 1 to 3 commands every day. This is the purpose of this article
10 Basic Linux commands that every Linux novice should remember