Short UNIX tutorial for VLSI lab
 
 
 Logging in
Choose the vlsi server from the list and press the 'OK' button
Type your username and password

Note: everything is case sensitive


 
 
 Logging out
Rightclick
Choose 'Log out ' option from the popup menu
Press the 'OK' button in the dialog box

 
 Files and directries
   All the information in the UNIX system is stored in its filesystem. The filesystem is organized in a tree structure of directories. The root of this tree is called root directory and is denoted by the '/' character. The directories contain files which store information. The system also considers any user to be located  somewhere in this tree structure. Such location is called the current working directory. The first current working directory after a user logs in is called home directory. This is the directory in which the user creates his or her directory subtree to store his or her files. The location of a particular file or directory in the structure is called path. The path is needed to access any file or directory. There are  two types of path: absolute - starts from the root directory, and non-absolute - starts from a user's current working directory. A path to file or directory is also refered to as the name of  a file or directory. The names of directories in a path or name are separated with the '/' character, for example /home/student/project/report.doc.
   There are three special directories in any UNIX system: / - the root directory, .. (2 dots) - the parent directory, . (1 dot) - the current working directory.

    The files and directories names are case sensitive.


 
 Simple Commands
Changing password:

   passwd  (short for password).

You will be asked to type your old password and then to type a new password twice.


Listing files and directories

   ls  (short for list)

This command lists the content (files and directories) of the current working directory.
 

   ls file_name

This command lists the file that has the name file_name if it exists in the current working directory.
 

   ls directory_name

This command lists the content of the direcory directory_name.


Createing directory

   mkdir directory_name(short for make directory)

This command creates directory directory_name in the current working directory.

Example: create directory for project zero -> type: mkdir project0
                    list the content to see the new created directory -> type: ls


Changing directory

   cd directory_name  (short for change directory)

This command changes the current working directory to directory_name. Typing cd without arguments changes the current working directory to home directory.

Example: change directory to project0 ->  type: cd project0
                    create a text file with an editor -> see section Editors


Finding out in which directory you are now

   pwd

This command prints the full path to the current working directory.

Example: check the path to the current working directory -> type: pwd


Copying files

   cp source_file dest_file  (short for copy)

This command copies the source_file and gives the new copy name dest_file.

   cp -r source_directory dest_directory

This command copies the content of the source_directory and puts the new copy in the dest_directory directory.

Example: change current working directory to home directory -> type: cd
                   create directory backup -> type: mkdir backup
                   create backup of project0 files -> type: cp -r project0 backup
                    list the content of the backuped directory -> type: ls backup/project0


Renamimng files and directories

   mv old_name new_name  (short for move)

This command changes the name (moves the content) of the old_name file or directory into new_name.

Example: change the current working directory to home directory -> type: cd
                    change the name of the directory from project0 into Project0 -> type: mv project0 Project0
                    list files and directories to see if the name is changed -> type: ls


Removing files

   rm file_name  (short for remove)

This command removes the file of the name file_name.


Removing directories

   rmdir directory_name  (short for remove directory)

This command removes the directory of the name directory_name. A directory must be empty (all files have to be erased) in order to be removed.

Example: remove the directory Project0 -> type: rm Project0
                    list the content of the directory to see if Project0 is removed -> type: ls


Getting help about a commands

   man command_name  (short for manual)

This command shows a command manual. To see the next page of a manual pres space key. To quit the manual press Q key.

Example: show manual of the ls command -> type: man ls



 
 Editors
Nedit

   nedit file_name

Nedit is a simple menu based  text editor with graphical interface.


Joe

   joe file_name

Joe is a command based text editor with a text interface. The commands are invoked by combination of keys. Some simple commands (^ denotes Control key):

Get help:  ^KH
Save file as: ^KD
Exit with saving: ^KX
Exit without saving: ^C
Mark begining of a block: ^KB
Mark end of block: ^KK
Save block: ^KW
Insert file: ^KR
Search: ^KF


VI

   vi file_name

VI is a command based text editor. The commands are invoked by combination of kyes or by typing. Some simple commands:

Exit without saving: :q! (colon, lower case q, exclamation mark)
Exit with saving: <Shift>ZZ
Insert text: i (press the I key and start typing text)
Add text at the end of line: <Shift>A
Finish typing text: <ESC>
Search: /<text to find><Enter>



 
 Printing
Text and postscript printing

   lp file_name

This command prints a text or postscript file on a default printer.

   lp -d printer_name file_name

This command prints a text or postscript file on a printer specified by printer_name.


Graphics printing

    xv

To print a graphics:
    open a file with an appropriate application 
    run xv (type xv)
    use xv to grab the window with the graphics
    save the grabbed picture in the postscript format
    print the obtained postscript with lp command



 
 Online Tutorials
UNIX tutorials for beginners:


VI tutorials: