I. Introduction: What is Unix?
II. Commands and Jobs
III. Files and Paths
IV. Basic Commands
a. Shell Commands
b. File Management
c. File Manipulation
d. Wildcard Resolution
e. Input/Output Redirection
V. Editors
VI. Mail
VII. Networking
I. Introduction: What is Unix?
Unix is an operating system. An operating system tells a computer how to process commands and programs that the users give it. An operating system is the foundation software of a machine; it schedules tasks, allocates storage, and presents a default interface to the user between applications. Some other operating systems are DOS, Windows, BeOS, Linux, and the Macintosh OS.
Unix is a highly developed, mature, very stable, complex, and immensely powerful operating system. Unix provides multi-tasking, multi-user abilities that allow multiple programs to run on one computer simultaneously, and multiple users to use one computer simultaneously; while most operating systems only work on a specific type of machine, Unix has different flavors so that it can be run on many different types of machines. In addition to the operating system, there is a shell; the shell takes commands from the user and modifies them to suit the operating system.
Since there are several different shells, this allows you to use Unix for different purposes, since each behaves in different ways. This is a powerful aspect of Unix which is not shared by Windows or the Macintosh Operating Systems.
If you have used the DOS command line, some of what follows will be familiar. If you have mostly worked with graphical user interface systems such as Windows or Mac OS, it may take a while before you become comfortable working with Unix.
II. Commands and Jobs
Some introductory notes about Unix commands and this guide:• File commands are designated by bold type; parameters are designated by italic type; optional parameters are shown enclosed in brackets []. Unix makes use of extra keys called control characters. These are entered by holding down on the control key and then pressing the key you want. These are denoted with a ^ in front of the character (so Control-c is written as <^c>).
Note: Some of these commands may conflict with keys used by the software on your terminal computer. For instance, if you type <^s> while using NCSA Telnet on the Macintosh, the screen will freeze until you type <^q>. To prevent this, go to the Session menu, select Setup keys... and delete the suggested keys.
• Unix is case-sensitive. Always use lower case unless otherwise specified.
• Unix commands take two forms of parameters: plain parameters, like file names; and flags, which are preceded by a hyphen (-). Multiple flags can be appended to each other and require only one hyphen. Most commands accept file name wildcards. The wildcards are * and ?. For example:
ls -la *txt
l and a are flags; * is a wildcard for any files ending with txt.
• To get online help with any command, use the man command (for manual).
man [command]
This will scroll the instructions on how to use the command, pausing after each page until you type .
man -k pattern
Special Files
This file is read with every new shell that is opened. It is the equivalent of .login for each
passwd - Sets or resets your login password.
logout, exit - Either one logs you out of the Unix system.
who, w - Either one displays all users logged on the local host.
w provides more information than who.
<^z> - Suspends a job (see “Suspended Jobs” above).
ps - Shows the processes that you are running on the system.
–r-Shows only processes currently running.
The supported Unix mail program at Haverford College is Elm. This package is much easier to use than the
elm:
Starts the Elm program; you can then use the inverse-video bar to select a
The following commands work within Elm:
m - Send a mail message.
r - Reply to the selected mail message.
mail
VII. Networking
ftp node- File Transfer ProtocolStanding this is used to transfer files from one system to another by opening a connection to a node (a remote host). The node address can be entered either as an IP address (165.82.1.31) or a computer name (venus.haverford.edu). Opening a connection can also be done from within ftp by typing open node. For file transfers from systems that you do not have an account on, the remote user name is usually “anonymous,” with your email address as the password.
The following commands work once a connection has been established:
The following commands work once a connection has been established:
cd dirname - Changes the current directory on the remote host.
lcd dirname - Changes the current directory on the local host.
get filename - Transfers the specified file from the remote host to the local machine.
mget wildcard- Gets all files matching the given file pattern.FTP will prompt for each file name.
mput wildcard- Sends multiple files (akin to mget).
telnet host
Opens a connection to a remote host. The addressing scheme is equivalent to that of FTP. This protocol will allow full capacity logins, but not file transfers. The host name can be either an Internet address or a name. You should only telnet to machines that you have an account on, or that permit anonymous logins (such as Tripod).
Returns control to the local console.
finger
Looks at logins to a computer as specified. Without any options, finger shows who is presently logged into the system. With an option, finger gives login information about a user. It also tells when mail was last checked, and contains certain information that the user can place in his or her .plan file.
Gives information concerning the person with that username on the system where finger is run (due to privacy concerns, this feature is mostly disabled on the Haverford system).
@hostname
Gives information about the users presently logged into the indicated host.