Top 25 Linux Commands for Beginners
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/cover.jpg?resize=720%2C340&ssl=1)
Linux is the open-source clone of Unix and the most popular operating system among developers, automation testing engineers, and security researchers. It is absolutely free but not very easy to use for beginners. Make note that it is also used by 95 percent of servers in data centers. If you know Linux commands, it definitely gives you an edge if you compare them with your colleagues. Today we will discuss the Top 25 Linux Commands for Beginners.
(1) cd
"cd" command is used to change the directory, either up or down. The same command is used in Windows to navigate into different folders. In the below example, the "cd" command changes the directory "Pictures".
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/cd.jpg)
(2) mkdir
This command is used to create a directory. In the below example, the directory "test" has been created in the directory "Pictures".
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/mkdir.jpg)
(3) grep
This command is used to search a particular string or pattern in a file. In the below example, "::" and "ff00" pattern search in file "hosts". Click Here If you are interested to learn similar commands in Windows.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/grep.jpg)
(4) chown
This command is used to change the user and group ownership of the given file.
In the below example, ownership of the user has changed.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/chown.jpg)
In the below example, ownership of both the user and group has changed.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/chown-group.jpg)
(5) chmod
This command is used to change the permissions of a file i.e. read, write and execute. In the below example, examples. desktop permissions change twice. In the first case, the owner has given read (r), write (w), and execute(x) permission to the user (file's owner), group (users who are members of the file's group), and other (users who are neither the file's owner nor members of the file's group).
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/chmod.jpg)
(6) rm
This command is used to remove/delete the files and directory. In the below example, the file "test.txt" and directory "testdir" deleted.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/rm.jpg)
(7) cat
This command is used to see the content of a file on the terminal screen. Click Here If you are interested in learning example usage of cat command.
$cat <filename>
(8) man
This command is used to see all the usage of the particular command.
$man <command>
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/man.jpg)
(9) ln
This command is used to create a symbolic link with the existing file.
$ln -s <filename> <linkname>
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/ln.jpg)
(10) echo
This command is used to display string or text.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/echo.jpg)
(11) more
This command is very useful to see the content of a very large file on one page at a time. Just type "more <filename>" to see the content of the file. By using more commands, you just do the forward movement in the file.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/more.jpg)
(12) less
This command is similar to more commands which are also used to view the content of the file on one page at a time. By using fewer commands, you can perform the backward movement as well as forward movement in the file. Just type "less <filename>" to see the content of the file.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/less.jpg)
(13) Pipeline ("|")
By using pipeline commands, the standard output of one command is fed into the standard input of another.
The below example is used "du" command to display a list of directories and occupied space. "sort -nr " sorts the list from largest to smallest taking the output of the first command "du" as input.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/pipeline.jpg)
(14) Standard Output (">")
To redirect standard output to a file, the ">" character is used.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/redirect-standard-output.jpg)
(15) >>
This command is used to append results in an existing file.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/append-command.jpg)
(16) Standard Input ("<")
To redirect standard input from a file 'test.txt', instead of the keyboard, use the "<" character.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/sort.jpg)
(17) ps
This command is used to list all current processes. Click here to know more about this command.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/ps.jpg)
(18) pstree -Au
This command is used to list out processes and their relationships.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/pstree.jpg)
(19) kill
This command is used to kill or stop a process by ID. This command depends on the process ID that you can find by using the "ps" command.
$kill <PID>
(20) top
This command is similar to "ps" command and is used to display the running processes by their CPU utilization. Use letter "q" to exit the window.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/top.jpg)
(21) mount
This command is used to mount a device to a folder to allow access.
(22) fdisk
This command is used to manipulate disk partitions.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/fdisk.jpg)
(23) nice/renice
nice command is used to assign priority to the running process. nice values range is -20 (highest priority) to 20 (lowest priority).
renice command is used to reallot the priority to the running process.
(24) du
This command is used to display the disk usage of files and directories on a machine.
![](https://i0.wp.com/allabouttesting.org/wp-content/uploads/2018/10/du.jpg)
(25) sudo
This command is used to run commands with elevated privilege. It stands for “super user do”. This is one of the most frequently used commands by Linux users. Click Here If you are interested in learning example usage of sudo command.
$sudo <command>
Other Useful Commands
(1) ls - This command is similar to dir command in Windows. It is a most basic Linux command and is used to list all directories and files in the current directory.
#Show all files including hidden files ls -a
#Show properties of files ls -l
(2) Pipe Output (>) - All commands usually print output on the terminal screen but this command helps you to save output on file.
ls -l > file.txt
finger - It displays information about the specific user.
finger <user>
(3) bg - This command sends a job to the background.
(4) fg - This command sends a job to the foreground.
(5) useradd - This command creates a user on the system.
useradd testuser
Conclusion
We have covered the Top 25 Linux commands used by developers and IT professionals. But Linux contains tons of other useful commands which we will cover in other articles on Linux.
Subscribe us to receive more such articles updates in your email.
If you have any questions, feel free to ask in the comments section below. Nothing gives me greater joy than helping my readers!
Disclaimer: This tutorial is for educational purpose only. Individual is solely responsible for any illegal act.