UNIX: Level I

Server Support Group

Enterprise Information Technology Services

wsg@listserv.uga.edu

This on-line course was written by Alan Ferrenberg. He would welcome any comments you might have on this course.

This page has been accessed times since May 14, 1996.


Conventions

Typewriter font = commands
Italic typewriter font = arguments to commands
Bold typewriter font = response from computer
% = system prompt
ENTER = press the ENTER key
^u = hold the Ctrl key and type u


Getting Help


Workstation Support

EITS provides UNIX and workstation support to the UGA computing community through the Workstation Support Group. To contact WSG


Flavors of Unix


The Unix Environment


The Unix Environment


The Unix Environment

It is possible to create aliases for commands in your login files. For example, to alias the command ls -l to be dir:

Shell Variables


Shell Variables

In general, shell variables that are special to the shell are written in uppercase, and user-assigned shell variables are written in lowercase:

Examples:
$HOME
$myvar
echo $HOME


Shell Variables

Several environmental variables are special to the shell. These include:

Shell Variables

To set shell environmental variables:

General Command Syntax

The general form of a command in UNIX is:

command is the name of any file both executable and locatable. A file is locatable if it is in one of the directories defined by the PATH variable or the path is supplied in the name.

Example:
ls -l /home/jones/dir1

General Command Syntax

Filename shorthand: there are some special characters that the shell recognizes as shorthand for filenames. These include:

? - substitute any character at that position: file?.txt (file1.txt, file2.txt, ...)
* - substitute any number of any character(s) at that position: file*.txt (file1.txt, file1a.txt, file.txt, ...)


General Command Syntax


General Command Syntax

It is possible to redirect command input and output away from the keyboard and screen and from/to files:

<
Read standard input from file
>
Write standard output to new file
>>
Append standard output to file
|
Send standard output from the first command to the standard input of the next

Examples:
ls > dir.list
ls $dir1 | more

The UNIX Filesystem

The top of the tree, commonly called the root, is denoted by a single forward slash (/). All files are located "below" the root directory.


The UNIX Filesystem


The UNIX Filesystem

Filenames are specified in one of three forms:

The UNIX Filesystem


The UNIX Filesystem


mkdir: Create a New Directory


rmdir: Remove a Directory


cat: Print a File to the Screen

cat is an all-purpose command:

mv: Move a File

The mv command moves and/or renames a file.

cp: Copy a File


rm: Remove/Delete a File


ls: List Files in Directories


find: Find Files and Manipulate Them


file: Determine the Type of a File


more: Look at a Screen of Output


tail: Look at the End of a File


diff: Compare Files


Processes and Job Control


Processes and Job Control

When a command or program is run from the command line, in most cases you will have to wait for it to finish before you can enter other commands. This is known as running interactively.

It is possible, however, to run commands and programs detached from the controlling terminal; this is known as running in the background. To run a command in the background, place an ampersand (&) at the end of the command line.

Example: Find all the files in your directories that end in .txt and list them, but don't wait for the command to complete:
find $HOME -name \*.txt -print > txt.list &

Note that the output is redirected to a file - otherwise, it would be sent to standard output and may interfere with what else you are doing.


Processes and Job Control


Processes and Job Control

Other useful commands:

Processes and Job Control


File Archiving Commands


File Archiving Commands


File Archiving Commands


File Archiving Commands