Top 10 Linux Commands

Top 10 Linux Commands
Written by sumit JalanJune 25, 2021
5 min read
Linux Administration
14 VIEWS 4 LIKES 2 DISLIKES SHARE
4 LIKES 2 DISLIKES 14 VIEWS SHARE
sumit Jalan

Devops Engineer

Top 10 Linux Commands

1. pwd
The pwd command stands for "print working directory" and will return your location in the file system, such as /usr/share or /home/matthew. This is useful if you forget where you are.

2. ls
When used alone, the ls command lists all of the files and directories contained in your current directory. You can also use ls to list the contents of a directory you have not navigated to by adding the directory location after the command, like this: ls etc/python.

3. cd
The cd command changes your working directory to a directory you specify. For example, cd /var/log takes you to the log directory that is contained in the var directory.

4. touch
The touch command creates an empty file using the filename you specify. Create a file now and then use cd to confirm that it was created in your current directory: touch examplefile.

5. rm
The rm command removes a file. To delete the file you just created, enter: rm examplefile.

6. mkdir
The mkdir command creates a directory. Create a directory now and then use cd to confirm that it was created in your current directory: mkdir exampledirectory.

7. rmdir
The rmdir command removes a directory. To delete the directory you just created, enter: rmdir exampledirectory.

8. mv
The mv command moves a file or a directory you specify to the location you specify. It is also used to rename files and directories. You can do both at the same time, if you like. For example, let's move a file named sample from our current working directory into an existing subdirectory called stuff while changing the name of the file to example: mv sample stuff/example.

9. cp
The cp command copies a file or directory you specify to the location and new filename you specify. Let's use the same example: cp sample stuff/example. The difference between what happens here and what happened with mv is that with cp, the original file remains.

10. man
The man command displays the manual page for the command you specify. Every command I have mentioned in this short article can do much more than you have learned thus far. In fact, we have just scratched the surface. Most commands have options, called switches, available to modify the default behavior. For example, when you enter man ls and view the man page for that command, you will learn about incredibly useful options like ls -al which will list not only file and directory names, but also very useful metadata about each file and directory.

Linux
Commands
Basics
14 VIEWS 4 LIKES 2 DISLIKES SHARE
4 LIKES 2 DISLIKES 14 VIEWS SHARE
Was this blog helpful?
You must be Logged in to comment
Code Block

2 Comments

Sophie Wilson

Nice Blog.

Erik Lian

Thank you for sharing this blog, it is really usefull.

sumit Jalan
Devops Engineer
+2 more
2 Blog Posts
7 Discussion Threads
Trending Categories
93
Software12
DevOps34
Frontend Development13
Backend Development13
Server Administration13
Linux Administration12
Data Center14
Sentry11
Terraform15
Ansible9
Docker13
Penetration Testing12
Kubernetes12
NGINX8
JenkinsX10
Jenkins18
SSL6
Ethical-Hacking10
Python8
NodeJs9
RedHat8
Github11
AngularJs15
Google Cloud Platform (GCP)6
SonarQube9
Amazon Web Service (AWS)2
VMware17
Blockchain6
Snipe-IT7