How to Copying/Renaming/Deleting a directory in unix?
How to Copying/Renaming/Deleting a directory in unix?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
Copying a Directory:
You can use the cp command to create a duplicate copy of a directory and its contents. To copy directory dir1 to directory dir2, type the below command.
cp -r dir1 dir2
Renaming Directory:
You can also use the mv command to rename and move directories. Just type the below command.The directory called dir1 will be given the new name dir2.
mv dir1 dir2
Deleting Directory:
To remove directories with rm, you must specify the -r option {recursive} It will remove all of the files and the subdirectories of the specified directory.
rm -r abc // abc is directory name