Top 25 Linux Commands for Beginners
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.
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".
(2) mkdir
This command is used to create a directory. In the below example, the directory "test" has been created in the directory "Pictures".
(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 in learning similar commands in Windows.
(4) chown
This command is used to change the user and group ownership of the given file.
In the below example, the ownership of the user has changed.
In the below example, ownership of both the user and group has changed.
(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).
(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.
(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 the example usage of cat command.
$cat <filename>
(8) man
This command is used to see all the usage of the particular command.
$man <command>
(9) ln
This command is used to create a symbolic link with the existing file.
$ln -s <filename> <linkname>
(10) echo
This command is used to display string or text.
(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.
(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.
(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.
(14) Standard Output (">")
To redirect standard output to a file, the ">" character is used.
(15) >>
This command is used to append results in an existing file.
(16) Standard Input ("<")
To redirect standard input from a file 'test.txt', instead of the keyboard, use the "<" character.
(17) ps
This command is used to list all current processes. Click here to know more about this command.
(18) pstree -Au
This command is used to list out processes and their relationships.
(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.
(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.
(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.
(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.