- Working With Directories -

The following commands are used to create and remove directories, and also for moving from one directory to another.

mkdir

This command allows you to create a directory using mkdir name, for example.
hostname:~bugsy> mkdir test
would make a new directory called test.

rmdir

This command allows you to remove empty directories, using rmdir name, for example:
hostname:~bugsy> rmdir test
This would remove the directory called test.
If the directry you are trying to remove is not empty, you will see the following message,
hostname:~bugsy> rmdir test
rmdir: test: File exists

In which case you will need to either move or delete any files in the directory before deleting it.

NOTE: Deleted directories can not be undeleted.

pwd

This command will give you the absolute path of your personal working directory, (the directory you are in at the time), for example:

hostname:~bugsy> pwd

/users/b/bugsy

This information tells us that we are in the directory bugsy which is in the directory b which is in the directory users which is in the directory / which is the root directory.

cd

This command allows you to change directories, in one of 3 ways.
Typing cd name would move you from the current directory into the directory name, if name is a subdirectory of the current directry.
Typing cd .. would move you from the current directory into the parent directory of the current directory. for example,

If you are in the directory with the path /users/b/bugsy/test/test2 and you wished to go back to the directory test, typing cd .. would do this. Typing cd .. a second time would take you to the directory bugsy and so on.
Typing just cd on its own, would take you back to your home directory.



Page Created 6th March 2005.
Last Modified 1st April 2005.