NOTATION
^x denotes holding down the control key and typing x.
If you are working at school, double click on the phobos or ssh client icon.
If you are working from home and have an Internet connection use telnet to get access to the our computer. Click on the start button, then the run button. Then type telnet phobos.ramapo.edu. Or, better still, download SSH Secure Client from CCIS.
In either case, you should get as response that ends with the following:
You will then type your user name, which will be given
to you in class. Next you will be prompted for your password. You will
then enter your password. This is for the sake of security you have been
given a nasty password. The
password must be 6 to 16 characters in length. For future changes of your
password, type passwd and then
follow the prompts to change the password. Note: some companies
configure their UNIX systems to force you to periodically change your password.
ls -l
Long listing of the files in the working directory.
ls pathname
List all the files in the specified directory.
more pathname
List the contents of the specified file. Mention less
tail pathname
List the contents of the end of a specified file. Defaults to listing 10
lines. Good for looking at log files.
cp f1 f2
Copy the contents of file f1 into file f2.
mv f1 f2
Rename f1 to be f2.
rm f1
Removes the file f1.
cd dirname
Changes the working directory to dirname.
cd ..
Makes the parent directory, the working directory.
cd
Makes your home directory the working directory.
rmdir dirname
Removes the directory dirname The directory must be empty.
mkdir dirname Creates the directory dirname.
rm -r dirname
Removes the directory dirname and all the files contained
within it. This is a dangerous command. It also comes in handy at times.
NOTE: UNIX assumes you know what you are doing. There is no "are you sure"
prompt.
pwd Displays the working directory.
^d or "logout" or "exit" Logs you off the system. To protect yourself, don't forget to log off.
^z stop the running program, but do not terminate it. The fg (foreground) command will restart it.
* Matches any string of characters.
? Matches any single characters.
EXAMPLE: ls *duck* will list all the files names that have the word "duck" appearing anywhere in them.
lab1.o: lab1.cpp
<tab> g++ -g -c lab1.cpp
note: don't forget to have a CR after the last statement. Otherwise it is
ignored on many UNIX systems.
Additional Commands
As the semester continues I will introduce some fancier commands.