x

DIRECTORIES Command in Unix

Prev     Next

Directories command in UNIX :

Directories:

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

Ex:


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”

Ex:

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.

Ex:

pwd

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.

Ex:

cd


Rm-rf Command:

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

Ex:

rm -rf work

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



Like it? Please Spread the word!