Using UNIX

Index

More Unix info

- - - - - - - - - - - - - - - - - - -

"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
  1. After you give this command, you are prompted for, and should enter, your current password. What you type for a password in this and the next two steps will not show up on your screen, to protect you from the wandering eyes of one who might be tempted to penetrate your account.
  2. You are then prompted for, and should enter, your desired (new) password.
  3. To protect against typing errors, you are prompted for, and should again enter, your new password. If the two entries for your new password agree, your password is correspondingly changed immediately.

In some versions of Unix, passwords may be required to satisfy properties such as
After you change your password, it's a good idea to logout, then login again immediately. This helps imprint in your memory that you have changed your password.
To index
- - - - - - - - - - - - - - - - - - -

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.

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 command
to get information on the "command". For example, to get more information on the C++ compiler, use
    man gcc    or    man cc
To 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 p1s
starts 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:

To index
- - - - - - - - - - - - - - - - - - -

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 filename
to "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: