Information Technology Reference
In-Depth Information
# mkdir /exam/Solaris/9
mkdir: Failed to make directory “/exam/Solaris/9”;
No such file or directory
# mkdir -p /exam/Solaris/9
# ls -lR /exam
/exam:
total 2
drwxr-xr-x 3 root other 512 Apr 13 17:33 Solaris
/exam/Solaris:
total 2
drwxr-xr-x 2 root other 512 Apr 13 17:33 9
/exam/Solaris/9:
total 0
#
Moving Directories Using the mv Command
The mv(1) command can be used to move a directory and its contents as if it
were an ordinary file, as shown in the following:
# ls -lR /exam
/exam:
total 2
drwxr-xr-x 3 root other 512 Apr 13 17:33 Solaris
/exam/Solaris:
total 2
drwxr-xr-x 2 root other 512 Apr 13 17:33 9
/exam/Solaris/9:
total 0
# mv /exam /test
# ls -lR /test
/test:
total 2
drwxr-xr-x 3 root other 512 Apr 13 17:33 Solaris
/test/Solaris:
total 2
drwxr-xr-x 2 root other 512 Apr 13 17:33 9
/test/Solaris/9:
total 0
Removing Directories Using the rmdir or rm Command
Both the rmdir(1) or rm(1) command can be used to remove directories.
The rmdir command is used to remove the directories specified as one
or more command-line arguments (separated by spaces). If a directory con-
tains files or other directories, the remove will fail. If the -p command-line
Search WWH ::




Custom Search