Next: Commands to manipulate a
Up: File and Directory Manipulation
Previous: File and Directory Manipulation
Home directory:
Every user account on IRIX account has a unique home directory. This directory
acts as a root for all the files and directories created by us. This is setup
by the system administrator at the time of creating the user account. This is
the default working directory every time we log in.
To give pathnames with our home directory as the starting point we should
use
as our first character in the path name.
For example the path
/doc/mydoc.doc specifies the
file mydoc.doc in the
sub-directory doc which is under our home directory.
- Present working directory:
The command pwd tells us what directory we are currently in.
- Changing directory:
The command cd directory_names changes the present working directory to the
new directory, if it exists. The command, cd takes us
to our home directory.
- Creating a directory:
A new directory can be created by mkdir command.
For example the command mkdir testDir will create a new directory
testDir in the present sub-directory, we are in.
- Moving a directory:
mv command allows the user to change the location of a directory and/or
its name.
- Deleting a directory:
A directory can be deleted by the following command:
rmdir directory_name
The directory is deleted only if it is empty.
If we want to delete a directory along with all its subdirectories then the
command rm -i -r directory_name. This command recursively deletes all the
subdirectories under the given directory and finally deletes the directory
itself.
- Listing the files in a directory:
The command ls lists the files and subdirectories in the present directory.
The command ls directory_name lists the files and subdirectories in the
specified directory.
Sushil Prasad
Fri Oct 9 10:28:36 EDT 1998