Copying, moving or deleting directories
by Sanju[ Edit ] 2009-11-20 18:43:45
Copying, moving or deleting directories
To create a new directory:
mkdir newdir
To copy the directory 'dir' in the destination directory 'destdir':
cp -a dir destdir
(Note: the '-a' option does a recursive copy - that is includes the subdirectories - and preserves the attributes of files)
To move the whole directory 'dir' inside the existing 'destdir':
mv dir1 destdir
To rename directory 'dir' as 'dir2':
mv dir dir2
To delete the directory 'dir' and all its content:
rm -rf dir