Must Learn!

Big Data


File Management becomes easy if you know the right commands.

Sometimes, commands are also referred as "programs" since whenever you run a command, actually, it's the corresponding program code, written for the command, which is being executed.

Let's learn the must know Linux commands.


Please be patient. The Video will load in some time. If you still face issue viewing video click here


Listing files (ls)


If you want to see the list of files on your UNIX or Linux system, use the 'ls' command.

It shows the files /directories in your current directory. 

Must Know Linux/Unix Commands



  • Directories are denoted in blue color.
  • Files are denoted in white.
  • You will find similar color schemes in different flavors of Linux.

Suppose, your "Music" folder has following sub-directories and files.

Must Know Linux/Unix Commands

You can use 'ls-R' to shows all the files not only in directories but also subdirectories 

Must Know Linux/Unix Commands


NOTE: The command is case-sensitive. If you enter, "ls - r" you will get an error

 'ls -al' gives detailed information of the files. The command provides information in a columnar format. The columns provide the following information:


1st Column

File type and access permissions

2nd Column

# of HardLinks to the File

3rd Column

Owner and the creator of the file

4th Column

Group of the owner

5th Column

File size in Bytes

6th Column

Date and Time

7th Column

Directory or File name


Let's see an example - 

Must Know Linux/Unix Commands

Listing Hidden Files

Hidden items in UNIX/Linux begin with -Must Know Linux/Unix Commandsat the start, of the file or directory.

Any Directory/file starting with a '.' will not be seen unless you request for it.  To view hidden files, use the command

ls  - a

Must Know Linux/Unix Commands

Creating & Viewing Files

The 'cat' command is used to display text files. It can also be used for copying, combining and creating new text files.  Let's see how it works

To create a new file, use the command

  1.  cat > filename
  2.  Add content
  3.  Press 'ctrl + d' to return to command prompt.

Must Know Linux/Unix Commands

To view a file, use the command -


Let's see the file we just created -  

Must Know Linux/Unix Commands

Let's see another file sample2 

Must Know Linux/Unix Commands

The syntax to combine 2 files is -

cat file1 file2 > newfilename

Let's combine sample 1 and sample 2.

Must Know Linux/Unix Commands

As soon as you insert this command and hit enter, the files are concatenated, but you do not see a result. This is because Bash Shell (Terminal) is silent type.  It will never give you a confirmation message like "OK" or "Command Successfully Executed". It will only show a message when something goes wrong or when an error has occurred.

In order to view the new combo file "sample" use the command

cat sample

Must Know Linux/Unix Commands

Note: Only text files can be displayed and combined using this command.

Deleting Files

The 'rm' command removes files from the system without confirmation.  To delete a file use syntax -


Must Know Linux/Unix Commands


Moving and Re-naming files

In order to move a file, use the command


Suppose we want to move the file "sample2" to location /home/guru99/Documents. Executing the command

mv sample2  /home/guru99/Documents

Must Know Linux/Unix Commands


mv command needs super user permission. Currently, we are executing the command as a standard user. Hence we get the above error. To overcome the error use command


Sudo program allows regular users to run programs with the security privileges of the superuser or root.

Sudo command will ask for password authentication. Though, you do not need to know the root password. You can supply your own password. After authentication, the system will invoke the requested command.

Sudo maintains a log of each command run. System administrators can trackback the person responsible for undesirable changes in the system

Must Know Linux/Unix Commands

For renaming file:

mv filename newfilename

Must Know Linux/Unix Commands

NOTE: By default, the password you entered for sudo is retained for 15 minutes per terminal. This eliminates the need of entering the password time and again.

You only need root/sudo privileges, only if the command involves files or directories not owned by the user or group running the comman

Directory Manipulations

Must Know Linux/Unix Commands

Enough with File manipulations!  Let's learn some directory commands

Creating Directories

Directories can be created on a Linux operating system using the following command


This command will create a subdirectory in your present working directory, which is usually your "Home Directory".

For example,

mkdir mydirectory

Must Know Linux/Unix Commands

If you want to create a directory in a different location other than 'Home directory', you could use the following command -


For example:

mkdir /tmp/MUSIC

will create a directory 'Music' under '/tmp' directory

Must Know Linux/Unix Commands

You can also create more than one directory at a time. 

Must Know Linux/Unix Commands

Removing Directories

In order to remove a directory, use the command -



rmdir mydirectory

will delete the directory mydirectory

Must Know Linux/Unix Commands

Tip: Ensure that there is no file / sub-directory under the directory that you want to delete. Delete the files/sub-directory first before deleting the parent directory. 

Must Know Linux/Unix Commands

Renaming Directory

The 'mv' (move) command (covered earlier) can also be used for renaming directories. Use the below given format:

mv directoryname newdirectoryname

Let us try it:

Must Know Linux/Unix Commands

Other Important Commands

The 'Man' command

Man stands for manual which is a reference book of a Linux operating system. It is similar to HELP file found in popular softwares.

To get help on any command that you do not understand, you can type


The terminal would open the manual page for that command.

For an example, if we type man man and hit enter; terminal would give us information on man command

Must Know Linux/Unix Commands

Must Know Linux/Unix Commands

The History Command

History command shows all the commands that you have used in the past for the current terminal session. This can help you refer to  the old commands you have entered and re-use them in your operations again.

Must Know Linux/Unix Commands

The clear command

This command clears all the clutter on the terminal and gives you a clean window to work on, just like when you launch the terminal.

Must Know Linux/Unix Commands

Pasting commands into the terminal

Many a times you would have to type in long commands on the Terminal. Well, it can be annoying at times, and if you want to avoid such a situation then copy, pasting the commands can come to rescue.

For copying, the text from a source, you would use Ctrl + c, but for pasting it on the Terminal you need to use Ctrl + Shift + v. You can also try Shift + Insert or select Edit>Paste on the menu


Must Know Linux/Unix Commands


Below is a summary of commands we have learned in this tutorial




Lists all files and directories in the present working directory

ls - R

Lists files in sub-directories as well

ls - a

Lists hidden files as well

ls - al

Lists files and directories with detailed information like permissions , size , owner etc.

cat > filename

Creates a new file

cat filename

Displays the file content

cat file file2 > file3

Joins two files (file1, file2) and stores the output in a new file (file3)

mv  file "new file path"

Moves the files to the new location

mv filename new_file_name

Renames the file to a new filename


Allows regular users to run programs with the security privileges of the superuser or root


Deletes a file


Gives help information on a command


Gives a  list of all past commands typed in the current terminal session


Clears the terminal


Creates a new directory in the present working directory


Create a new directory at the specified path


Deletes a directory


Renames a directory