DIRECTORIES Command in Unix

Prev     Next

Directories command in UNIX :


  • The directories in the Unix File management is the storage of files. In other words, it can be called as folders in windows.
  • All the directories in the Unix will start with “d” followed by permissions. By this we can differentiate which one is file and which one directory.
  •  Let us see on how to create a directory in Unix using the below example.

Mkdir command:

  •             This command is used to create the directory (Folder) in the Unix operating system.
  •             Mkdir means make a new directory.


mkdir work

Cd Command:

  • This command in Unix system is used to change the directory. Also, we can call it as go to another directory. Using “mkdir” command we have created a new directory called “work” under the directory “sss”.
  •  By using the below example, we can go to the newly created directory “work”


cd work

  • By using the command “ls -lrt”, we can see the files available in the new directory. As we have not created any files under the directory “work”, it is displaying the total 0.
  • By using the commands listed in the Files section, we can create files in the “work” directory.

Pwd Command:

This command is used to display the present working directory in the Unix system.



Cd command without argument:

If we want to go back to the home directory from the sub directories without going back one by one, we can use cd command without any argument. We can simply enter “cd” in the command prompt and press the Enter Key.



Rm-rf Command:

This command is used to delete the directory In the Unix system.


rm -rf work

When we delete the directory, the files under the directory will also be deleted.

Like it? Please Spread the word!