Index
|
|
"cis" (full name: "cis.niagara.edu") is a computer that uses the UNIX operating system and is available to all Niagara students. UNIX is an operating system that, in many respects, is very nice to use, but its notation takes some getting used to. In particular, the names of many of its utility programs are very different from their analogs' in other operating systems that Niagara students may use, such Windows or DOS.
CASE SENSITIVITY: One important difference between UNIX and some other operating systems is that UNIX is case-sensitive (i.e., it matters whether the letter you type is capitalized or in lower case) in command names and file names, while Windows and DOS are not. For example, if you have a file in UNIX stored under the name "proj1.cc", you may not refer to that file as "PROJ1.CC" or as "Proj1.cc".
To index
INTERRUPTING A PROGRAM/PROCESS: Most programs and processes running under Unix may be interrupted or "broken" via ^c (control-c). For example, a student testing her/his computer program may find that the program is caught in an infinite loop. It would be useful to interrupt the program with ^c.
To index
CHANGING YOUR PASSWORD: The command that initiates the process of changing your password is
passwd
EDITING a FILE: The vi editor is available on cis and other Unix systems. Also available is the pico editor familiar to users of Pine e-mail.
NOTE: Unlike VMS (until recently available to Niagara users on the VAX), UNIX replaces old files with new versions -- it doesn't automatically save old versions as backups. If you wish to save an old version, use "mv" (to rename, as described below) or "cp" (copy).
To index
COMMUNICATIONS SOFTWARE in UNIX: Mail, talk, Telnet, and
FTP are available on many Unix systems.
pine (lower case letters)Pine is menu-driven, hence should be fairly easy to figure out. If, however, you prefer explicit to empirical learning about Pine, click here.
You may use FTP to copy a file from one computer to another. You may establish an FTP connection from the Niagara network of PCs to cis.niagara.edu via
ftp cisand then upload/download a file as described. At the current writing, cis is not directly connected to a printer available to most users, so this is a good way to print cis files -- FTP them to another computer from which you can print.
If you have login permission on another Internet computer, you may also use FTP to establish a connection from cis to the other computer and use FTP to copy files between these computers.
By using communications software, it is easy to prepare a file such as a C++ program on one computer and use it on another.
To index
COMPILING a C or C++ PROGRAM: See this link.
To index
GETTING HELP: The UNIX "help" command is "man" (for "manual" -- the on-line help often is just a verbatim copy of explanations that may be found in UNIX manuals). Use it in the form
man commandto get information on the "command". For example, to get more information on the C++ compiler, use
man gcc or man ccTo index
SCRIPT FILES: This allows you to record what appears on your screen. To start a script file, use a command of the form
script file-name-- for example,
script p1sstarts a script file called "p1s". This begins the process of recording what appears on your screen until you stop the recording process, so you now take whatever actions you wish to record, e.g., running a program to demonstrate to your instructor how your project works. When you are ready to stop the recording, strike ^d (control-d). This will stop the recording. You may then use either FTP or Windows copy-and-paste operations to copy the script file to your PC in order to print it. To index
PRINTING a file on screen:
more filenamewill print the file on your screen, one screen at a time. When it pauses, you may respond via
space to print the next screen;
return to print the next line;
q to quit.
The "cat" command may be used to print one or several files on the screen, without pausing (as "more" pauses) for a user to read the screen and signal continuation. Thus, "cat" might typically used to print files within a script file. E.g.,
cat proj2.datwill print the file named "proj2.dat";
cat proj2.cc proj2.dat proj2.xwill print the files "proj2.cc", "proj2.dat", and "proj2.x" on the screen.
LISTING YOUR DIRECTORY: use
ls to get a list of files in the directory, or ls -l to get a list of files and associated data.To index
DELETING A FILE: use
rm filenameto "remove" the file from your directory. The asterisk (*) may be used (as in Windows, DOS) as a wildcard, e.g.,
rm * removes all files in the current directory
rm a*.txt removes all files with first letter "a" in the
filename and with extension ".txt"
rm blah.hm removes the file named "blah.hm"
To index
DIRECTORY OPERATIONS:
CREATE A SUBDIRECTORY via a command of the form
mkdir directory-name ("mkdir" - "make directory")
REMOVE (DELETE) AN EMPTY DIRECTORY via a command of the form
rmdir directory-name
CHANGE DIRECTORY via "cd". Some examples:
cd to go to user's root directory
cd sub1 to go to "sub1" subdirectory of current directory
cd sub1/sub2 to go to "sub1" subdirectory of current directory and
then to "sub2" subdirectory of "sub1" subdirectory
cd .. to go up one level
cd ~/blah to go to "blah" subdirectory of root directory
PRINT THE WORKING DIRECTORY (identify which directory you're currently working in) via
pwd
RENAME A FILE via "mv" ("move") in the form
mv oldfilename newfilename
MOVE A FILE to a different directory via "mv" in the form
mv filename destinationdirectoryFor example,
mv proj1.cc cpp-files/cis265will move the file "proj1.cc" from the current directory to the "cpp-files" subdirectory of the current directory - indeed, to the "cis265" subdirectory of the "cpp-files" directory.
mv sample.dat ~/projdatawill move "sample.dat" from the current directory to the root (indicated by the "~") directory's "projdata" subdirectory.
COPY A FILE via "cp". Examples:
Within the same directory: use the form
cp source-file-name destination-file-nameE.g.,
cp proj3.cc proj3.bakmakes a copy of "proj3.cc" under the filename "proj3.bak".
To copy a file from another directory to the current directory, use the form
cp remote-directory/filename . (the period
means "here")
E.g.,cp abc/survey.dat .copies the file "survey.dat" from the "abc" subdirectory to the current directory.
PIPELINING: Unix allows processes to be "pipelined" so that a single command may be given that directs a sequence of processes such that output from one process is to be used as input for the next process. The pipe symbol (sometimes called the "broken pipe"), "|", is used for this purpose.
An example: Suppose you wish to study your directory via
ls -lbut the directory is too large to fit on one computer screen. You may apply "more" to the directory via
ls -l | morewhich may be interpreted as follows: the command "ls -l" prepares the display of a directory (which ordinarily would immediately be printed on the screen). If, instead, we pipeline the result of "ls -l" through "more", the directory display is taken to be the input file of "more". Try it.
Multiple pipes may be used with a single command. Thus, to direct program "a" to produce output that will be used as input by program "b", which in turn produces output that is used as input to program "c", use
a | b | cTo index
Back to Boxer's Home Page