Frequently used Linux Commands for Beginners

Frequently used Linux Commands for Beginners

1. Objective

In the globe 90% of the IT industries consider Linux as the most reliable, safe and secured 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 tutorial you will feel very confident to work on linux operating system.

2. Linux Commands

2.1. ls

a. Usage:

|  $ ls

This command shows list of all the files and directories present on the current working directory of your machine.

b. Usage:

| $ ls ~  

This command shows the list of files that are present in your home directory.

c. Usage:

| $ ls -ltr  

This command will display you the file having named mentioned in command and will give you all the details of that file.

d. Usage:

| $ 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 file name, file permissions, owner of the file, group, date and time of file creation and links.

2.2. df

a. Usage:

| $ df  

“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.

b. Usage:

| $ 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 (mega byte) and GB (gigabyte).

2.3. mkdir

a. Usage:

| $ mkdir  

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.

2.4. rm

a. Usage:

| $ rm  

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 on your current working directory.

b. Usage:

1  $ rmdir

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.

2.5. pwd

a. Usage:

| $ pwd  

“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.

2.6. cd

a. Usage:

| $ cd  

“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.

b. Usage:

| $ cd /  

This command is used to navigate into the root directory of users linux filesystem.

c. Usage:

| $ cd

| $ cd ~

 

 

This command is used to navigate to the home directory of the user.

d. Usage:

| $ cd..  

This command is used to navigate one directory level up of the user current working directory.

e. Usage:

| $ 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 recent visited directory.

2.7. clear

a. Usage:

| $ clear  

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 form a fresh new screen we use “clear” command. This command clears all the data present on your linux terminal window.

2.8. mv

a. Usage:

| $ mv  

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.

2.9. cp

a. Usage:

| $ cp  

This command is used to copy files/directory from one place to another. With the help of this command user can easily create multiple copies of a files/directories.

2.10. cat

a. Usage:

| $ cat  

This command displays all the contents of a file specified by the user on the standard output device i.e. your computer screen.

2.11. du

a. Usage:

| $ du  

The term “du” is 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.

b. Usage:

| $ 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 human readable format like bytes, mega bytes, giga bytes, etc.

2.12. touch

a. Usage:

| $ touch  

This command creates an empty file with the specified name on the present working directory of the user. An empty file with size 0 bytes gets created which remains unchanged until user makes any changes on it.

2.13. who

a. Usage:

|  $ who

It displays the number of users who are currently logged on your linux operating system.

2.14. echo

a. Usage:

| $ echo  

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”.

2.15. date

a. Usage:

| $ date  

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.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *