UNIX Short Manual - Rahman Tashakkori, Department of Computer Science, Appalachian State University
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 systems. If you are already on a UNIX machine skip step (0) otherwise go to step (1).
Step (0) : Getting into a UNIX machine from a PC :
User is using a PC with Windows operating system to connect to a UNIX machine through Telnet. To establish the connection, use the Telnet manual first to make the connection, then go to the next step.
Step (1) : Logging into the machine:
We need a Login Id and a Password on the department UNIX machine. These two are unique to each individual. You are given one by the system administrator. 
Login : your ID  (Press Enter) Password: your password  (Press Enter)

You will get the command prompt : cs.appsate.edu or a % or a
1-0) To Check who you are (just in case you are not sure) type: % whoami
1-1) To find information about someone, for instance me, Rahman Tashakkori, who may have an account on this system, at the command prompt type :
% finger rahman OR % finger Tashakkori
1-2) To check the date type: % date
1-3) To create a directory on the system type: % mkdir (anyname)
1-4) To get a listing of the contents of the directory that you are in type: % ls 
1-5) To go to that directory type: % cd name of the directory (from 1-3)
1-6) To check your working directory type: % pwd (write:  ............................ )
1-7) To create two directories under the newly created directory :
type : % mkdir dir1    then  % mkdir dir2
1-8) To go to dir1 type : % cd dir1
1-9) To go back one step down type: % cd ..
1-10) To go to dir2 type: % cd dir2
1-11) To go back all the way to your home directory type: % cd
1-12) Go to the directory that you had created in step 1-3.
Type % pwd to make sure you are in correct directory.
1-13) To copy three files (file1, file2, file3) from a directory, unixfiles, under my home directory type: (Don't forget the . )
% cp ~rt/unixfiles/file1  .  Or % cp ~rt/unixfiles/file1  file1
% cp /u/csd/rt/unixfiles/file2  .  Or  % cp /u/csd/rt/unixfiles/file2  file2
Copy file3 the same way.

1-14) To rename file1 to history type : % mv file1 history
1-15) To make a copy of file history type : % cp history  history_org
1-16) To see the contents of the file history type : % more history
1-17) To delete file3 type : % rm file3
1-18) To delete directory dir2 type : % rmdir dir2
1-19) To see the contents of a directory with all details type : % ls -la
1-20) To copy file test.C from my directory type : % cp ~rt/unixfiles/test.C .
1-21) To copy file test2.C, type : % cp ~rt/unixfiles/test2.C .   (. is required)
1-22) To copy file input from that directory type: % cp ~rt/unixfiles/input .
1-23) Type % ls to list the contents of the directory.
Step (2) : Compiling and Running a C++ program
This test.C file is a simple program written in C++. Let's see if we can compile and run it. Notice that the C++ files has ".C" extension.
2-1) To compile the test.C type: % g++ test.C (it creates  a.out)
2-2) To run the code type: % a.out
Let's try to read an input file and create an output file:
2-3) To compile the test2.C program type: % g++ test2.C
2-4) To run the program with input/output type: % a.out < input > output
Note that the input file already exists but the output file will be created.
2-5) To see the contents of the output file type: % more output
2-6) To print the file type: % lp output
Step (3) : Script (save all the actions in a file)
Sometimes, you want to have a file that contains your program, your input, and your output. In other words, a file that contains all the activities you have had to get your program to the end point.  Script is a powerful tool provided by UNIX operating system for this purpose. 
3-1) To start the script type : % script 
3-2) To view your program in the script type: % more test2.C
3-3) To compile the program type: % g++ test2.C
3-4) To run the program type : % a.out < input > output
3-5) To view the output file type : % more output
3-6) To stop the script press Cntrl and D at the same time.
You just created the file typescript that contains 3-2 to 3-6.
3-7) Type ls to make sure that script file (typescript) exists
3-8) To mail the file to yourself type: % mail YourID < typescript
rev : Aug. 2001