This Linux commands tutorial will provide you top 15 frequently used Linux commands. In the globe, 90% of the IT industries consider Linux as the most reliable, safe and secure operating system. Linux is considered as the best operating system in all leading IT industries today for project development and deployment in production. Hence it is very necessary for all of us to learn how to work on Linux. At the end of this Linux Commands tutorial, you will feel very confident to work on Linux operating system.
2. Linux Commands Tutorial
In this Linux commands tutorial top 15 Linux commands are given below along with their usage-
This Linux command shows a list of all the files and directories present in the current working directory of your machine.
$ ls ~
This command shows the list of files that are present in your home directory.
$ ls -ltr
This command will display you the file having named mentioned in command and will give you all the details of that file.
$ ls –ltr
This command will list you all files according to the order of time in which they were created. Here “ltr” stands for l- long listing, t- time, r- recursive. The list displayed contains a file name, file permissions, owner of the file, group, date and time of file creation and links.
“df” is “disk filesystem”. The actual task of this command is to show a detailed summary list of the total disk space available and used disk space on file system of your Linux system.
$ df -h
‘-h’ parameter is used to display the summary of the total disk space used and available on your Linux file system in human readable form, this means it shows the details in the form of bytes, MB (megabyte) and GB (gigabyte).
If you want to create a new directory on your Linux filesystem you have to use “mkdir” command. For example- “mkdir dataflair”, this command will create a directory named dataflair on your Linux filesystem.
This command is used to remove a file from your Linux filesystem. Executing this command will delete that particular file of which you had written name followed by rm. For example- “rm data”, this will remove file named data present in your current working directory.
This command is used to remove a complete directory from your Linux filesystem. This command will remove directory specified by you. For example- “rmdir mystuffs” will delete the mystuffs directory from your Linux filesystem.
“pwd” = “Present Working Directory”. It gives you the name of the directory name on which you are currently present or working and shows the path of that directory.
“cd” is change directory. By the name itself, it is clear that this command is the most useful command of Linux. With the help of this command, a user can easily navigate to the directory of his choice at any moment of time. This command changes the present working directory of the user, to the directory name specified by the user in which he wants to navigate.
$ cd /
This command is used to navigate to the root directory of users Linux filesystem.
$ cd $ cd ~
This command is used to navigate to the home directory of the user.
This command is used to navigate one directory level up of the user current working directory.
$ cd -
The usage of cd command is to navigate to the previous directory or simply go one directory back to the directory which user visited. It is used to go one step back to the recently visited directory.
Now after practicing a number of commands, it is obvious that your command terminal has fully filled up with lots of commands and their usage. Hence to practice a new command from a fresh new screen we use “clear” command. This command clears all the data present on your Linux terminal window.
The main function of this command is to change the name of a file/directory or to move a particular file/directory from one place to another.
This command is used to copy files/directory from one place to another. With the help of this command, the user can easily create multiple copies of a files/directories.
This command displays all the contents of a file specified by the user on the standard output device i.e. your computer screen.
The term “du” is a short form of “Disk Utility”. The actual work of this command is to display you the details about how much space is occupied by a file/directory in the disk.
$ du -sh
In the above command (“-s”= Summary and “-h”= Human Readable). This means it shows the details of the space occupied by a file/directory on disk in a human readable format like bytes, megabytes, gigabytes, etc.
This command creates an empty file with the specified name in the present working directory of the user. An empty file with size 0 bytes gets created which remains unchanged until the user makes any changes to it.
It displays the number of users who are currently logged on your Linux operating system.
This command displays all the text written after the word “echo”. For example- echo My House name is Sweet Dreams, this command output will be: “My House name is Sweet Dreams”.
This command displays the current date and time of your system. By using this command you can easily know the current day and time on Linux terminal.