Section I.
INTRODUCTION TO UNIX
Advanced Unix Concepts
On Unix systems there is a special user called root (also known as
the super user or privileged user) who has complete control over
all processes and files/directories, regardless of permissions or
ownership. Only root may use many system commands, especially
those that change the configuration of the system.
Environmental Variables
You may easily customize your environment by setting variables to
specific values to suit your needs; most are pre-defined for you
by the system administrator but can be changed. Depending on
which command interpreter (shell) has been defined for you,
variables are set in configuration files that reside in your home
directory. The Bourne shell executes commands and sets variables
defined in the .profile file, while the C-shell first executes the
.login file, then the .cshrc file. The .cshrc file is also
executed every time the csh command is executed on the command
line. When you log off using the C-shell, the commands found in
the .logout file are executed.
*** Note *** Be extremely cautious modifying configuration files;
it is advisable to first copy the file to a backup
copy.
Some useful commands which can be included in your .configuration
file(s) are:
alias - if you put a line in your .cshrc file like:
alias lo logout
you can then enter lo which the shell will expand to
logout. This is particularly useful for long, complicated
commands.
history - a line containing:
set history=100
will cause the shell to store up to the last 100
commands. To display the history list, enter:
% history
at the command prompt and the history list will be
displayed. To re-execute the 13th command, enter:
% !13
To save the history list as a log of your activities, add
the line:
history >>~/history.log
to your .logout file.
prompt - setting this variable, your prompt can look like whatever
you choose.
stty - stty commands can be used to change the value of terminal
configuration variables (see man pages).
There are many commands which display information, or do specific
tasks to help you manage your environment. Some useful commands
are:
passwd - changes your password
ps - displays processes and status
kill - used to terminate a locked process
quota - reports current disk usage and limits
find - searches the filesystems for files/directories
df - reports filesystems currently mounted and disk usage
statistics
w - reports who is logged on the system
*** Note ***
1) see the on-line man pages for syntax of specific commands
2) see Unix Command Summary for other useful commands
One of the great advantages of Unix is the ability to run commands
detached from the terminal you are using. To run a process in the
background, simply append an & (ampersand) to the end of the line.
Example:
% ls -lR / >~/all.files &
causes a long, recursive listing of the entire filesystem, putting
the output into a file called all.files in your home directory,
running detached from your terminal.
To display the status of any such jobs, enter the command:
% jobs
With three processes running in the background, to bring job 2 to
the foreground, enter:
% fg %2
To move a command running in the foreground to the background,
enter:
% ^Z
to stop the job, then
% bg
Note: Not all shells support job control.
[ Next ]
[ Back ]
[ UNIX/Linux Intro Start ]
[ Chibcha Enterprises Home ]