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.
The command pwd tells us what directory we are currently in.
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.
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.
mv command allows the user to change the location of a directory and/or its name.
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.
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.