UNIX Short Manual (print landscape)
This manual is designed to familiarizes users with some of the commonly used UNIX commands. Please follow all the instructions. The first thing we need to do is to work on a machine that has UNIX as its operating system. 
Note: In this manual, the words written in boldface, for eg. Login, indicate what will show up on the screen. The words following a % symbol and written in boldface, for eg. % passwd, are to be typed out ( without the % symbol). The words written in regular font following the % symbol and boldfaced commands are to be substituted by filename/directory names in your system or your user ID and passward as given to you by your system administrator.
Step (0) : Logging into and logging out of the machine:
You need a Login Id and a Password on the department's UNIX machine. These two are unique to each individual. You are given one by the system administrator. Both login names and passwords are case sensitive.
0-0) Once connected to a system you will be prompted for your login name: 
Login : your ID  (Press Enter) 
Password: your password  (Press Enter). 
Some machines will ask users to change password when they login for the first time. If you are asked to change your password, make it something that is not easy to guess. A combination of letters, numbers and special characters, up to 8 characters is recommended. 
Once logged in successfully, you will get a prompt, which may look like  > % or  $ . This prompt is called the command prompt .
0-1) You can change your password at anytime, by typing % passwd (Press Enter). The passwd command will prompt you for the following information: 
Old password: your current password (Press Enter) 
Your new password: your new password (Press Enter)
Retype your new password: your new password (Press Enter) 
0-2) To logout of the system type : % logout (Press Enter)
Step (1) : Basic Unix Commands 
File Commands
Step Description Command
1-0 To list all the files in your directory type % ls
1-1 To copy a file first_file in your current directory to a file second_file type % cp first_file  second_file 
1-2 To copy a file first_file in your current directory to the same file name in a directory dir1 type % cp first_file  dir1
1-3 To copy a file first_file in directory dir1 to your current working directory type % cp dir1/first_file   .
(Don't forget  . )
1-4 To move a file or to rename a file type % mv old_filename new_filename
1-5 To delete or remove a file type % rm filename
1-6 To view (no edit) the contents of a file on your screen type % cat first_file OR % more first_file
Directory Commands
Step Description Command
1-7 To create a directory named first_dir on the system type % mkdir first_dir
1-8 To rename a directory type % mv old_dirname new_dirname
1-9 To change the current directory to first_dir type % cd first_dir
1-10 To change the current directory to your home directory type % cd
1-11 To change the current directory to the parent directory, i.e one step back/up type % cd ..
1-12 To check your working directory type % pwd
1-13 To remove a directory type (Make sure that the directory is empty before attempting to remove it) % rmdir first_dir
Miscellaneous Commands
Step Description Command
1-14 To check who you are (just in case you are not sure ) type % whoami
1-15 To find information about someone, who may have an account on this system, type % finger user_id OR % finger last_name
1-16 To check the date type % date
1-17 To view the online manual for a command type  % man command_name (for example, to view the online manual for the command ls, type % man ls )
Step (2) : Compiling and Running a C++ program
Although you may use a different editor to edit your programs, for this example we assume you are using Pico to write your programs.
2-0) % pico hello.cpp  (you may also use hello.C)
2-1) Type the following 6 lines into your blank screen
      #include <iostream>
      int main()
            cout<<"Hello World, this is ME \n";
            return 0;
2-2) Once you are done, press Ctrl-x (^ X) to save and exit the file
2-3) Let's make a backup copy. At promp, type: % cp hello.cpp hello.bkup
2-4) Now let's compile hello.C type: % g++ hello.cpp (It creates a.out)
2-5) To run the hello.C program type: % a.out

rev : July 2002