3.4.11 Changing Directories

3.4.11 Changing Diretories 

Use cd to change the current working directory; give the name of the target directory as an argument. For an example to change the current working dire ctory to 'work', a subdirectory in the current directory

$ cd work

To change to parent directory $ cd .

You call also give the full path name of a directory. To change the current working directory to . /usr/doc'

$ cd /usr/doc

Basic command

$ pw d : getting the name of the current directory

$ ls : Listing the directories

$ tree : Listing the directory tree graphs

$ cp <file 1> <file 2> : copy file1 and create file2

$ mv file1 /ict : moves file1 to specified directory

$ rm file1 : Delete a file

$ rm <directory> : Delete a directory ( if empty)

$ gzip xyz : To compress xyz

$ gunzip xyz.gz : Decompressing a file

$ tar –cvf f1 project : To create an archive called ‘project.tar’ from the contents of the

project directory

$ tar –tvf project.tar : To list the contents of an archieve called ‘project.tar’

$ tar –xvf project.tar : To extract the contents of an archive called ‘project.tar’

$ mke2fs /dev/fdO : To format a floppy disk in the first removable floppy drive

$ mount /dev/fd0 /mnt/floppy : Mounting a Floppy Disk

$ umount /mnt/floppy : UnMount a Floppy Disk

Last modified: Friday, 22 June 2012, 7:37 AM