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 and not very easy to use. It is also used by 95 percent of servers in data centers. Knowing Linux commands definitely gives you an edge if you compare with your colleagues. Today we will discuss the Top 25 Linux Commands for Beginners.
"cd" command is used to change the directory, either up and down. The same command used in WIndows to navigate into different folders. In the below example, the "cd" command is used to change the directory "Pictures".
This command is used to create a directory. In the below example, the directory "test" has been created in directory "Pictures".
This command is used to search a particular string or pattern in a file. In below example, "::" and "ff00" pattern search in file "hosts". Click Here If you are interested to learn similar commands in Windows.
This command is used to change the user and group ownership of the given file.
In below example, ownership of the user has changed.
In below example, ownership of both user and group have changed.
This command is used to change the permissions of a file i.e. read, write and execute. In below example, examples.desktop permissions change twice. In first case, owner has given read (r), write (w) and execute(x) permission to 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).
This command is used to remove/delete the files and directory. In below example, file "test.txt" and directory "testdir" deleted.
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.
This command is used to see all the usage of the particular command.
This command is used to create a symbolic link with the existing file.
$ln -s <filename> <linkname>
This command is used to display string or text.
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 command, you just do the forward movement in file.
This command is similar to more command which also used to view the content of the file on one page at a time. By using less command, 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.
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 first command "du" as input.
(14) Standard Output (">")
To redirect standard output to a file, the ">" character is used.
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.
This command is used to list out 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.
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.
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.
This command is used to mount a device to a folder to allow access.
This command is used to manipulate disk partition.
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.
This command is used to display the disk usage of files and directories on a machine.
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.
Other Useful Commands
(1) ls - This command is similar to dir command in Windows. It is a most basic command in Linux and used to list out 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 terminal screen but this command helps you to save output on file.
ls -l > file.txt
finger - It displays information about the specific user.
(3) bg - This command sends a job to background.
(4) fg - This command send a job to foreground.
(5) useradd - This command create a user on system.
We have covered 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.