next up previous contents
Next: Commands to manipulate a Up: Basic IRIX commands Previous: Basic IRIX commands   Contents

Commands to manipulate a directory

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 $\sim$ as our first character in the path name.

For example the path $\sim$/doc/mydoc.doc specifies the file mydoc.doc in the sub-directory doc which is under our home directory.

  1. Present working directory

    The command pwd tells us what directory we are currently in.

  2. 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.

  3. 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.

  4. Moving a directory

    mv command allows the user to change the location of a directory and/or its name.

  5. 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 alongwith 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.

  6. 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.


next up previous contents
Next: Commands to manipulate a Up: Basic IRIX commands Previous: Basic IRIX commands   Contents
Sushil Prasad 2004-09-16