Directory related command in Linux system

                                              Directory related command

Directory creation
#mkdir dir1 --- Make a single directory named dir1

Create multiple directory at a time
#mkdir dir1 dir2 dir3 --- Create dir1 dir2 dir3 at a time

Create a directory under a new directory 
#mkdir -p dir3/dir4 --- Create directory dir4 under directory dir3 at a time

Rename an existing directory
#mv dir1 dir2 --- Rename directory dir1 as dir2

Delete an empty directory
#rmdir dir1 --- Delete an empty directory named dir1

Delete a directory with which contain data
#rm -rf dir1 --- Delete dir1 directory or file if it has content.
#rm -r dir1 --- Delete dir1 directory or file if it has content with prompting for conformation.

Make a hidden directory
#mkdir .dir1 --- Create a hidden directory named .dir1

0 comments :

Post a Comment