Monday 2 December 2013

Directory Commands

1)  cd [directory] ---change directory
You can change to a new directory with the cd command. cd will accept both absolute and relative path names.
cd -----changes to user's home directory
cd / ---changes directory to the system's root
cd .. ---goes up one directory level
cd ../.. --goes up two directory levels
cd /full/path/name/from/root changes directory to absolute path named (note the leading slash)
cd path/from/current/location changes directory to path relative to current location (no leading
slash)
cd ~--------username/directory changes directory to the named username's indicated directory

2) mkdir [options] --directory make a directory
You extend your home hierarchy by making sub-directories underneath it. This is done with the mkdir command. Again, you specify either the full or relative path of the directory:
Syntax
mkdir [options] directory

3) rmdir [options] directory -------remove a directory
A directory needs to be empty before you can remove it. If it’s not, you need to remove the files first.Also, you can’t remove a directory if it is your present working directory; you must first change outof it.
Syntax
rmdir directory

No comments:

Post a Comment