Basic Linux Commands That NeedsTo Rememberd 💯

Photo by Ben White on Unsplash

Basic Linux Commands That NeedsTo Rememberd 💯

In this post we will see the top 10 linux command that needs to be remembered

1. sudo 🪴

This SuperUserDo is the most important command Linux newbies will use. Every single command that needs root’s permission, need this sudo command. You can use sudo before each command that requires root permissions –

$ sudo su

2. ls (list) 🪴

Just like the other, you often want to see anything in your directory. With list command, the terminal will show you all the files and folders of the directory that you’re working in. Let’s say I’m in the /root directory and I want to see the directories & files in /home.

root@LinuxAndMint:~# ls Desktop snap

3. cd 🪴

​Changing directory (cd) is the main command that always is in use in the terminal. It’s one of the most Linux basic commands. Using this is easy. Just type the name of the folder you want to go in from your current directory. If you want to go up just do it by giving double dots (..) as the parameter.

$ cd /usr

4. mkdir 🪴

Just changing directory is still incomplete. Sometimes you want to create a new folder or subfolder. You can use mkdir command to do that. Just give your folder name after mkdir command in your terminal.

~$ mkdir folderName

5. cp 🪴

copy-and-paste is the important task we need to do to organize our files. Using cp will help you to copy-and-paste the file from the terminal. First, you determine the file you want to copy and type the destination location to paste the file.

$ cp path-to-source-file destination-path

6. rm 🪴

rm is a command to remove your file or even your directory. You can use -f if the file need root permission to be removed. And also you can use -r to do recursive removal to remove your folder.

$ rm myfile.txt

7. apt-get 🪴

This command differs distro-by-distro. In Debian based Linux distributions, to install, remove and upgrade any package we’ve Advanced Packaging Tool (APT) package manager.

$ sudo apt-get update

$ sudo dnf update

8. grep 🪴

You need to find a file but you don’t remember its exact location or the path. grep will help you to solve this problem. You can use the grep command to help to find the file based on given keywords.

$ grep user /etc/passwd

9. cat 🪴

As a user, you often need to view some of text or code from your script. Again, one of the Linux basic commands is cat command. It will show you the text inside your file.

$ cat CMakeLists.txt

10. poweroff 🪴

And the last one is poweroff. Sometimes you need to poweroff directly from your terminal. This command will do the task. Don’t forget to add sudo at the beginning of the command since it needs root permission to execute poweroff.

$ sudo poweroff

Â