BASIC UNIX COMMANDS

(revised 1 Sep 2005)

Explanatory Text Copyright (C) 1995 - 2005 by Robert N. Barger


       [you must press ENTER after each command for it to execute]

%        While in the pine mailer, prints a copy of the current e-mail
         message

cal m yyyy   prints a calendar for a given month of a given year. 
             E.g., cal 1 2000 would print a calendar on the screen 
             for January, 2000 (cal 2000 prints the whole year)

cat x    scrolls file x on the screen without page breaks

cat a b > c   Joins file b to the end of file a and names the new
              combined file as file c

cd x     changes the directory to a subdirectory (where "x" is the 
         name of the subdirectory)
 
cd \     [then hit ENTER *twice*] changes directory from a 
         subdirectory back to the main directory (do this  
         before changing from one subdirectory to another)

clear    clears the screen

cp x y   makes a copy of file x, naming the copy "y" [note: if your 
         computer does not respond to the command "cp" try typing the
         command as "copy" since the two letter alias is not available 
         on all UNIX systems] 

date     prints the day, date, and time

finger   shows who else is presently sharing use of your computer 

finger @somehost  shows all users logged-on at some remote host. 
                  E.g., finger @bureau.ucc.ie  will show all users 
                  logged-on at University College Cork, in Cork City,
                  County Cork, Republic of Ireland

hostname shows the name of the computer on which you are logged-on

lp x     prints a copy of file x at the printer currently specified
(or)     for your terminal       
lpr x)      

ls       lists the contents of your directory (if "ls" doesn't work, 
         try "list")

ls -a    lists all files including the dotted (hidden) files

ls -l    lists files with their size and date/time of last edit

man x    invokes the UNIX manual, displaying information about the
         queried function (where "x" is the name of the function)      

mkdir x  creates a directory named x as a subdirectory of the 
         directory in which you are when you create it

xxx | more   displays output of the command before the pipe-sign one 
             screen at a time (where xxx stands for the command). 
             E.g., if the command is:  finger | more
             all users currently logged on a server will be displayed one
             screen at a time. Press space bar to see the next screen

mv x y   changes the name of file "x" to be file "y" [note: if your
         computer does not respond to the command "mv" try typing the
         command as "move"]
pg x     pages through file x one page at a time (hit ENTER to see the 
         next page) [note: if your computer does not respond to the 
         command "pg" try typing the command as "page"]

pine     puts you into the mailer function

pico x   puts you into the "pico" editor (where "x" is the name of the 
         file to be edited) ...note that, if the file "x" has been 
         previously created, this command brings up file x for a new
         editing session; if "x" is a new file (if you are just now 
         creating it) then the editor window will display the phrase 
         "new file" after you type "pico x"

 ctrl x  exits and saves file
 ctrl d  deletes the character that the cursor is on
 ctrl k  deletes the line that the cursor is on
 ctrl u  undeletes the last deletion and puts it where the cursor currently is
 ctrl r  imports (inserts) a file
 !p      reopens the last file edited 

pwd      tells you the directory in which you are currently working 

rm x     deletes (removes) the file named x (note: if, as a safety 
         feature, you are asked something like "remove x?" you respond 
         with a y (for "yes") and then hit ENTER to remove the file 

rmdir x  removes the directory named x (which must be empty...and you
         must be one directory level above x to execute this command)

telnet somehost  Establishes an Internet connection to some host, e.g.:
                 telnet darwin.helios.nd.edu 
                 (you will then be asked for your afs userid and then
                 you will be asked for your password)

traceroute (remote host) returns the route of a transmission to the named
                         remote host

w        gives some of the same information as "finger," plus 
         information on the processes being run by the users and some
         information about the host computer (time up, load, etc.) 

w userid Gives process being run by the named individual user         

wc       gives the number of lines, the number of words, and the number
         of characters in a file. E.g., wc unix.html

who      shows users on the current node and the name of the connection
         at which they are working

whois (host) returns the identity and administrators for the named host

Some notes on memory size:

1 bit = the smallest unit of memory (electronically either "on" or
        "off"...written in machine language as either "1" or "0")

1 byte = 8 bits (storage space for one keyboard character)

1 Kilobyte (1KB) = 1,024 bytes

1 Megabyte (1MB) = 1,024 Kilobytes (1,048,576 bytes)

1 Gigabyte (1 GB)= 1,024 Megabites (1,073,741,824 bytes)