UNIX Command
UNIX Command
UNIX Command
3. Useful Files
/boot/vmlinuz - the typical location and name of the Linux kernel. In the Slackware distribution,
the kernel is located at /vmlinuz.
/dev/fd0 - first floppy disk drive
/dev/fd0H1440 - driver for the first floppy drive in high density mode. Generally, this is
invoked when formatting a floppy drive for a particular density. Slackware comes with drivers
that allow for formatting a 3.5" diskette with up to 1.7MB of space. Red Hat and Mandrake do
not contain these device driver files by default.
/dev/fd1 - second floppy disk drive
/dev/hda - first IDE hard drive
/dev/hdc - on many machines, the IDE cdrom drive. Most often, there is a symbolic link
called /dev/cdrom which is just a link to the true cdrom driver file.
/dev/null - used when you want to send output into oblivion
/etc/aliases - file containing aliases used by sendmail and other MTAs (mail transport agents).
After updating this file, it is necessary to run the newaliases utility for the changes to be passed
to sendmail.
/etc/bashrc - system-wide default functions and aliases for the bash shell
/etc/conf.modules - aliases and options for configurable modules
/etc/crontab - shell script to run different commands periodically (hourly, daily, weekly,
monthly, etc.)
/etc/DIR_COLORS - used to store colors for different file types when using ls command. The
dircolors command uses this file when there is not a .dir_colors file in the user's home directory.
Used in conjunction with the eval command (see below).
/etc/exports - specifies hosts to which file systems can be exported using NFS. Man exports
contains information on how to set up this file for remote users.
/etc/fstab - contains information on partitions and filesystems used by system to mount different
partitions and devices on the directory tree
/etc/HOSTNAME - stores the name of the host computer
/etc/hosts - contains a list of host names and absolute IP addresses.
/etc/hosts.allow - hosts allowed (by the tcpd daemon) to access Internet services
/etc/hosts.deny - hosts forbidden (by the tcpd daemon) to access Internet services
/etc/group - similar to /etc/passwd but for groups
/etc/inetd.conf - configures the inetd daemon to tell it what TCP/IP services to provide (which
daemons to load at boot time). A good start to securing a Linux box is to turn off these services
unless they are necessary.
/etc/inittab - runs different programs and processes on startup. This is typically the program
which is responsible for, among other things, setting the default runlevel, running the rc.sysinit
script contained in /etc/rc.d, setting up virtual login terminals, bringing down the system in an
orderly fashion in response to [Ctrl][Alt][Del], running the rc script in /etc/rc.d, and
running xdm for a graphical login prompt (only if the default runlevel is set for a graphical
login).
/etc/issue - pre-login message. This is often overwitten by the /etc/rc.d/rc.S script (in Slackware)
or by the /etc/rc.d/rc.local script (in Mandrake and Red Hat, and perhaps other rpm-based
distributions). The relevant lines should be commented out (or changed) in these scripts if a
custom pre-login message is desired.
/etc/lilo.conf - configuration file for lilo boot loader
/etc/motd - message of the day file, printed immediately after login. This is often overwritten by
/etc/rc.d/rc.S (Slackware) or /etc/rc.d/rc.local (Mandrake/Red Hat) on startup. See the remarks
in connection with /etc/issue.
/etc/mtab - shows currently mounted devices and partitions and their status
/etc/passwd - contains passwords and other information concerning users who are registered to
use the system. For obvious security reasons, this is readable only by root. It can be modified by
root directly, but it is preferable to use a configuration utility such as passwd to make the
changes. A corrupt /etc/passwd file can easily render a Linux box unusable.
/etc/printcap - shows the setup of printers
/etc/profile - sets system-wide defaults for bash shell. It is this file in Slackware that sets up the
DIR_COLORS environment variable for the color ls command. Also sets up other system-wide
environment variables.
/etc/resolv.conf - contains a list of domain name servers used by the local machine
/etc/securetty - contains a list of terminals on which root can login. For security reasons, this
should not include dialup terminals.
/etc/termcap - ASCII database defining the capabilities and characteristics of different consoles,
terminals, and printers
/etc/X11/XF86Config - X configuration file. The location in Slackware is /etc/XF86Config.
/proc/cpuinfo - cpu information
/proc/filesystems - prints filesystems currently in use
/proc/interrupts - prints interrupts currently in use
/proc/ioports - contains a list of the i/o addresses used by various devices connected to the
computer
/proc/kcore - The command ls -l /proc/kcore will give the amount of RAM on the computer. It's
also possible to use the free command to get the same information (and more).
/proc/version - prints Linux version and other info
/var/log/messages - used by syslog daemon to store kernel boot-time messages
/var/log/lastlog - used by system to store information about last boot
/var/log/wtmp - contains binary data indicating login times and duration for each user on system
4. Important Directories
Different distributions have different directory structures, despite attempts at standardization
such as the the Linux Filesystem Hierarchy Standard (FHS) organization.
/bin - essential UNIX commands such as ls, etc. Should contain all binaries needed to boot the
system or run it in single-user mode
/boot - files used during booting and possibly the kernel itself are stored here
/dev - contains device files for various devices on system
/etc - files used by subsystems such as networking, NFS, and mail. Includes tables of disks to
mount, processes to run on startup, etc.
/etc/profile.d - contains scripts that are run by /etc/profile upon login.
/etc/rc.d - contains a number of shell scripts that are run on bootup at different run levels. There
is also typically an rc.inet1 script to set up networking (in Slackwar), an rc.modules script to
load modular device drivers, and an rc.local script that can be edited to run commands desired
by the administrator, along the lines of autoexec.bat in DOS.
/etc/rc.d/init.d - contains most of the initialization scripts themselves on an rpm-based system.
/etc/rc.d/rc*.d - where ``*'' is a number corresponding to the default run level. Contains files for
services to be started and stopped at that run level. On rpm-based systems, these files are
symbolic links to the initialization scripts themselves, which are in /etc/rc.d/init.d.
/etc/skel - directory containing several example or skeleton initialization shells. Often contains
subdirectories and files used to populate a new user's home directory.
/etc/X11 - configuration files for the X Window system
/home - home directories of individual users
/lib - standard shared library files
/lib/modules - modular device driver files, most with .o extensions
/mnt - typical mount point for many user-mountable devices such as floppy drives, cd-rom
readers, etc. Each device is mounted on a subdirectory of /mnt.
/proc - virtual file system that provides a number of system statistics
/root - home directory for root
/sbin - location of binaries used for system administration, configuration, and monitoring
/tmp - directory specifically designed for programs and users to store temporary files.
/usr - directory containing a number of subdirectory with programs, libraries, documentation,
etc.
/usr/bin - contains most user commands. Should not contain binaries necessary for booting the
system, which go in /bin. The /bin directory is generally located on the same disk partition as /,
which is mounted in read-only mode during the boot process. Other filesystems are only
mounted at a later stage during startup, so putting binaries essential for boot here is not a good
idea.
/usr/bin/X11 - most often a symbolic link to /usr/X11R6/bin, which contains executable binaries
related to the X Window system
/usr/doc - location of miscellaneous documentation, and the main location of program
documentation files under Slackware
/usr/include - standard location of include files used in C programs such as stdio.h
/usr/info - primary location of the GNU info system files
/usr/lib - standard library files such as libc.a. Searched by the linker when programs are
compiled.
/usr/lib/X11 - X Window system distribution
/usr/local/bin - yet another place to look for comon executables
/usr/man - location of manual page files
/usr/sbin - other commands used by superuser for system administration
/usr/share - contains subdirectories where many installed programs have configuration, setup
and auxiliary files
/usr/share/doc - location of program documentation files under Mandrake and Red Hat
/usr/src - location of source programs used to build system. Source code for programs of all
types are often unpacked in this directory.
/usr/src/linux - often a symbolic link to a subdirectory whose name corresponds to the exact
version of the Linux kernel that is running. Contains the kernel sources.
/var - administrative files such as log files, used by various utilities
/var/log/packages - contains files, each of which has detailed information on an installed
package in Slackware. The same file can also be found at /var/adm/packages, since the adm
subdirectory is a symbolic link to log. Each package file contains a short description plus a list
of all installed files.
/var/log/scripts - package installation scripts in Slackware are stored here. You can inspect these
scripts to see what special features are included in individual packages.
/var/spool - temporary storage for files being printed, mail that has not yet been picked up, etc.
afio - utility to copy or restore files to an archive file. This utility is not part of the basic internal
and external programs under Red Hat Linux. It is available as an rpm on the rpmfind.net site.
agetty - enables login on terminals. See getty, mgetty, and uugetty.
ali - list mail aliases
alias - assign name to specified command list. This is actually a shell builtin. On my Red Hat
system, I have global alias commands in my /etc/bashrc file and in my /.bashrc file. On my
Slackware box, I have made the rm command a little bit safer with
alias rm='rm -i'
so that you can't recursively delete your /dev directory without telling the system you're sure
you want to do it.
alien - utility to convert to and from different Linux package formats. Can handle Debian (deb),
Stampede (stp), Red Hat (rpm) and Slackware (tgz) packages.
apropos - display command names based on keyword search
usage: apropos keyword
apsfilter - printer filter called by lpd to deal with printing different types of files. This is a fairly
sophisticated print filter. It is not set up by default in Slackware. It used to be available on the
second cd of a Slackware distribution. Since 4.0, it is available as one of the main packages in
the ap set. Read the mail that the installation program sends to the root user. I believe that Red
Hat uses its own printer filters.
ar - create, modify and extract from archives
arch - print machine architecture type
as - the portable GNU assembler
asapm - AfterStep laptop advanced power management utility
ash - a shell, a very simple shell program sometimes used on boot diskettes since it takes up
much less space than bash, tcsh, zsh, etc.
asload - AfterStep cpu load monitor
asmail - AfterStep mail checking utility
asmodem - AfterStep utility to monitor modem status
aspell - a spell checking program along the lines of ispell
aspostit - X Window postit note utility
at - executes a shell script at specified time. Use atq to show pending jobs, and atrm to remove
jobs from the queue.
usage: at time
or: at -f file time
atq - shows pending jobs queued by at. If run by root, shows everybody's pending jobs.
atrm - removes pending jobs queued by at. Use atq to determine the identities of various jobs.
usage: atrm job
bash - Bourne again shell. This is the default shell in the Red Hat installation.
batch - queue, examine, or delete jobs for later execution. See at.
bc - a language (compiler) similar to C, with unlimited precision arithmetic
bg PID - send process with pid ``PID'' to the background. This is the same as executing
[Ctrl]z while interacting with the running process. This is a shell builtin.
bh - puts a job in the background. This is a shell builtin.
biff - mail notification utility. Notifies user of mail arrival and sender's name.
bind - displays or redefines key bindings. This is a shell builtin.
bison - parser generator similar to yacc
bru - a powerful backup utility program. Commercial. Demonstration versions are often
included with Linux distributions such as Red Hat.
bsh - equivalent to ash
bunzip2 - used to uncompress files compressed with bzip2
byacc - parser generator
bzip2 - compresses with algorithm different from gzip
bzless - view bzipped files
c++ - invokes GNU C and C++ compiler
cal - displays a 12-month calendar for the given year or a one-month calendar of the given
month
usage: cal month year
cat - combine, copy standard input to standard output. Used to join or display files.
cd - change working directory. This is a shell builtin in bash, tcsh and zsh.
cdplay - command line utility for playing audio cds
cfdisk - similar to fdisk, but menu-driven
chat - used to interact with a modem via a chat script
chgrp - changes group associated with file. Can be used to change the group associated with
subdirectories and files of a directory.
usage: chgrp group files
or: chgrp -R group files
chkconfig - Query or update system services/daemons for different runlevels. Manipulates the
various symbolic links in /etc/rc.d. This utility is included with many rpm-based distributions
such as RedHat and Mandrake. It is designed to work with System V initialization scripts.
Graphical tools for configuring system services include ntsysv, tksysv and ksysv (the latter is a
KDE utility).
chmod - set permissions (modes) of files or directories. A value of 4 is used for read permission.
A value of 2 is used for write permission. A value of 1 is used for execute permission. See
umask for default file permissions upon file creation. Chmod can also be used to change the
suid bit on files. The syntax for the symbolic version is
chmod [options] who operation permission file-list
cpio - direct copy of files to an output device. Allows creation of archive file spanning multiple
diskettes. Allows one directory structure to be mirrored elsewhere on the partition or on another
partition. In order to back up an entire directory structure on diskettes, cd to the directory and
use the following command:
find . -depth -print | cpio -ov > /dev/fd0
will display detailed disk usage for each subdirectory starting at root, giving files sizes in bytes.
dumpkeys - print information about the keyboard driver's translation tables to standard output
dvilj - send a dvi file to a Laserjet printer. There are specialized versions for individual models
of Laserjet printer.
dvilj2p - specialized version of dvilj for the IIp series of printers. See above.
dvips - send a dvi file to a Postscript printer, to a Postscript capable Laserjet printer, or to a file
(with the -o option). There is a switch to print only a subset of the pages, and another switch to
print in landscape mode. Use -t landscape, which is one of the arguments to the paper type
switch. If you have one page of a document that is a wide table, and you wish to print this in
landscape mode, use
dvips filename -pp pagenumber -t landscape
e2fsck - check an ext2 filesystem. The syntax is
e2fsck /dev/devicename
where the filesystem is on /dev/devicename. The device should not be mounted, and this
program must be run as root.
echo - write arguments to standard output. One use is to print out information about
environment variables, as in
echo $PATH - list paths to search
echo $HOME or echo ~ - list name of home directory
This is a shell builtin.
editres - a dynamic resource editor for X Toolkit applications. Allows the user to change X
resources for individual applications.
efax - fax program
efix - convert between fax, text, bit-map and gray-scale formats
egrep - search files for lines that match regular expressions. Runs faster than grep and fgrep.
elm - an interactive mail system
elvis - a version of the vi text editor
emacs - screen oriented text editor
env - desplay the current environment or set a variable equal to a new value
eval - scans and evaluates the command line. See dircolors command. This is a shell builtin.
ex - interactive command-based editor. The man page lists it as being the same as vim, an
improved version of vi.
exec - system call which creates a subshell to execute a binary or a script. This is a shell builtin.
execve - a variation of the exec command.
exit - exit a shell. This is a shell builtin.
expand - convert tabs in files to spaces and write to standard output
expect - a program that ``talks'' to other interactive programs according to a script. Following
the script, Expect knows what can be expected from a program and what the correct response
should be. An interpreted language provides branching and high-level control structures to
direct the dialogue. In addition, the user can take control and interact directly when desired,
afterward returning control to the script.
export - place the value of a variable in the calling environment (makes it global). This is a shell
builtin.
expr - utility evaluates an expression and displays the result
f2c - FORTRAN to C translator
f77 - FORTRAN 77 compiler
false - null command that returns an unsuccessful exit status
fax - simple user interface to efax and efix programs
fc - views, edits, and executes commands for the history list. This is a shell builtin.
fdformat - low level format of a floppy device
fetchmail - retrieve mail from a remote mail server and pass it to local SMTP agents on the local
machine
fdisk - used to partition hard drives
usage: fdisk device
fg PID - bring a background or stopped process with pid ``PID'' to the foreground. This is a
shell builtin. If only one process is running in background mode, fg with no argument is
sufficient to bring it to the foreground
fgrep - search for patterns in files
file - displays classification of a file or files according to the type of data they contain
find - find files according to a large variety of search criteria. The find command that I use the
most is
find . -name filename -print
in order to find files matching a particular name on the working directory and all subdirectories.
Find can be incredibly powerful, but it is incredibly obscure.
finger - display information about a specified userid or userids
fmt - simple text formatting utility. Tries to make all nonblank lines nearly the same length.
fold - break lines of specified files so they are no wider than a specified lengths
fortune - available in the bsdgames package in Slackware and other distributions. Put a call to
fortune in /etc/profile and get something inspirational or amusing every time you fire up an
xterm as a login shell.
free - gives used and free memory on system along with other useful information
fromdos - takes a DOS text file from stdin and sends a UNIX file to stdout.
fsck - file system check and repair
ftp - file transfer over network
g++ - C++ compiler
g77 - GNU Fortran 77 compiler
gawk - GNU awk, mostly for processing delimited text files
gcc - invoke C, C++ compiler
getipts - parses arguments to a shell script. This is a shell builtin.
getkeycodes - print kernel's scancode-to-keycode mapping table
ghostscript - set of printing utilities. It seems to be obligatory to have this if a TEX installation
such as teTEX is installed. How they communicate with one another is somewhat obscure.
ghostview - Aladdin ghostscript interpreter/previewer
gimp - image manipulation and paint program
glint - Red Hat graphical front end for the rpm package installer and manager.
grep - used to find a string within a file. The -i option returns matches without regard to case.
The -n option means that each line of output is preceded by file name and line number. The -v
option causes non-matched lines to be printed.
usage: grep pattern files
or: grep -i pattern files
or: grep -n pattern files
or: grep -v pattern files
groupadd - create a new group on the system
groups - shows which groups you are in
grub - Gnu grand unified bootloader. Can be used instead of lilo to boot multiple operating
systems. I encountered a couple of snafus trying to install grub on my home machine after
installing Mandrake 8.0 and choosing the lilo bootloader during the initial install. The
documentation suggests installing grub on a diskette using the ``dd'' command. This refused to
work, but
grub-install '(fd0)'
did work. The single quotes are necessary. The files necessary to run grub are normally located
in /boot/grub. Once the file menu.lst has been edited and appropriated entries added to boot the
different operating systems on one's hard disk(s), the following sequence of commands can be
used to install grub in the master boot record (MBR) sector of the hard disk:
root (hd0,x)
setup (hd0)
Here, the x should be replaced by the partition where the /boot/grub directory is located, which
is probably the root partition of the Linux system. Note that grub has its own conventions for
naming devices and numbering partitions, so that for example a partition which is called hda6
under Linux will be called (hd0,5) by grub.
grub-install - command to install grub on the hard drive (or floppy drive).
gunzip - used to uncompress files compressed with gzip
gv - PostScript and PDF previewer, based on ghostview
gvim - see vi
gzexe - compresses executables
gzip - used to compress or decompress files
halt - shut down system as root, without reboot, immediately
hash - remembers the location of commands in the search path. This is a shell builtin.
head - displays first part of a file
history - command for viewing and manipulating the shell command history list
host - look up host names using domain server
hostname - used to get or set hostname. Typically, the host name is stored in the file
/etc/HOSTNAME.
hwclock - used to query and set the hardware clock
hylafax - commercial fax program
id - display userid and groupid
inetd - daemon which starts up other daemons on demand. Configured in /etc/inetd.conf.
ifconfig - display (as root) information on network interfaces that are currently active. First
ethernet interface should be listed as eth0, second as eth1, etc. First modem ppp connection
should be listed as ppp0, etc. The ``lo'' connection is ``loopback'' only.
ifdown - shut down the network interface
ifup [interface_name] - start up the interface
info - display system information. This is the GNU hypertext reader.
init - the mother of all processes, run at bootup, executes commands in /etc/inittab. Can be used
(with root privileges) to change the system run level.
usage: init run_level
jed - programmer's file editor. Behaves like emacs. Has modes for TEX, FORTRAN, C, etc.
jobs - displays list of current jobs in the background. This is a shell builtin.
joe - simple WordStar-like text editor. It can be invoked in emacs emulation mode with jemacs
and in WordStar emulation mode with jstar.
jove - Joseph's Own Version of Emacs. A simple emacs clone.
kbd_mode - print current keyboard mode
kernelcfg - GUI to add/remove kernel modules (as root in X terminal).
kerneld - kernel daemon, a process that stays in memory and does all sorts of useful stuff, like
automatic loading of device driver modules
kikbd - a utility program that comes with KDE that allows users to switch on the fly among
different international keyboards. It can be used under different window managers than kfm.
kill - sends a signal to (especially to terminate) a job or process. This is a shell builtin in bash,
tcsh and zsh.
killall - kill processes by name. Kill all processes which are instances of the speciffied program.
Also used to send signals to processes or restart them.
killall5 - kill all processes except the ones on which it depends
last - generate a listing of user logins
lastlog - prints the last login times of all users
latex - compile a LATEX file
ldconfig - creates the necessary links and cache (for use by the run-time linker, ld.so) to the
most recent shared libraries found in the directories specified on the command line, in the file
/etc/ld.so.conf, and in the trusted directories (/usr/lib and /lib). Ldconfig checks the header and
file names of the libraries it encounters when determining which versions should have their
links updated. Ldconfig ignores symbolic links when scanning for libraries.
ldd - list the shared libraries on which a given executable depends, and where they are located
leave - display reminder at specified time
less - Linux alternative to ``more'' command. Displays text files, one screenful at a time. When
less pauses, there is a large number of available commands to tell it what to do next. One can
scroll both forwards and backwards.
let - evaluates a numeric expression. This is a shell builtin.
lilo - installs boot loader on the boot sector of a hard drive, of a diskette, or in another location.
My 486 has a hard drive that is too large for the machine's BIOS, so I have to boot from a
floppy. To create a boot diskette, I do the following (as root):
/sbin/fdformat /dev/fd0H1440
/sbin/mkfs.ext2 /dev/fd0
mount -t ext2 /dev/fd0 /mnt/floppy
cp -dp /boot/* /mnt/floppy
/sbin/lilo -C /etc/lilo.flop
The -C option to lilo has lilo use the lilo.flop file instead of the default lilo.conf.
linuxconf - interactive tool for configuring Linux system. Uses X if loaded. This is a Gnome
tool. It comes with my Red Hat distribution, and is not included with Slackware. It would seem
to be the easiest way to configure Linux under Slackware. Version 1.15 is available for
Slackware. There is a pretty good introduction to the use of linuxconf in the Red Hat 5.2
installation manual, which is available online at their web site.
ln - creates a link to a file. Used to create hard links and, with the -s option, symbolic links
which can link files on different disk partitions. The syntax is
ln [options] source [dest]
locate filename - find the file name which contains the string ``filename''. The syntax is easier
than the find command.
lock - temporarily lock terminal
lockfile - create semaphore file(s), used to limit access to a file
- log in to system
logname - consult /etc/utmp for user's login name
logout - execute logout as individual user and bring up login: prompt
look - look for strings in files
lpq - show print jobs that are waiting
lpr - send file to be printed
lprm - cancel a job from print queue
ls - list directory contents. To get colored directory listings under Red Hat, Mandrake, etc., use
ls -color
The user's home directory on the remote system must contain the file .rhosts with a list of users
(preceded by the full domain name or exact IP address of their machine) with access privileges.
localhostname username
rcs - creates or changes the attributes of an RCS file. Stands for Revision Control System.
rdev - query/set image root device, swap device, RAM disk size, or video mode in kernel
read - reads line from standard input. This is a shell builtin.
readonly - declares a variable to be read only. This is a shell builtin.
reboot - in Slackware, reboots the system. Seems to be equivalent to shutdown -r now in generic
Linux.
renice program_name - resets the priority of process ``program_name''.
reset - used to reset the screen characteristics. This is useful if the screen gets messed up from,
for example, trying to display a binary file in an xterm.
return - exits from a function. This is a shell builtin.
rlog - prints a summary of the history of an RCS file
rlogin - log in to remote computer. The general syntax is as follows, using the UQAM Nobel
machine as an example:
rlogin -l userid nobel.si.uqam.ca
The remote computer must recognize the local user and the local machine. See the rcp
command for how to set up the .rhosts file on the remote machine.
rm - remove files or directories. With the -r (recursive) option (very dangerous!), can be used to
remove the contents of a specified directory including all subdirectories.
rmail - interpret and handle remote mail received via uucp
rmdir - remove empty directories
rmmod - used to remove modular device drivers
route -n - show routing table. The n option returns numerical addresses rather than names.
rpm - invokes the Red Hat package manager in command line mode. I often use this command
in query mode to query packages about what files they contain and to find out which package
owns a particular file. Examples are
rpm -qil foo. Gives package information and a file list for the package foo.
rpm -qfil foo. Gives package information and a file list for the package that owns the file foo.
Foo must be in the working directory, or the full path to foo must be specified.
We need to find out about installing the rpm package on a Slackware box. It's probably better to
use a package converter such as alien.
rpm2tgz - an extremely useful utility on Slackware systems that converts rpm packages to tgz
format. They can then be installed using the installpkg command (or pkgtool).
rsh - execute shell command on a remote computer. See rcp and rlogin.
rstat - summarize host's status: uptime, load averages, and current time
ruptime - show host status of local machines
rusers - list who is logged on local machines
rwall - write to all users over a network
rwho - show who is logged in on a LAN. The rwho service must be enabled for this command
to run. If it isn't, run ``setup'' as root. I don't understand this last remark, which comes from
``Linux Newbie Administrator Guide''.
rxvt - a terminal program similar to xterm, but which has less features and uses less memory
sed - edits a file (not interactively). Also a tool for processing text files.
set - set or display value of shell variables. This is a shell builtin. The command
set | less
prints the current user environment, giving the values of currently defined variables.
setenv - set or display value of environment variables
setserial - used by root to configure a serial port
setterm - set terminal attributes for a virtual console
setuid - set the id of a program when it is run. Used, for example, to give root privileges to a
program run by an ordinary user. This is actually done by running the chmod program as root.
See the chmod command for the syntax.
setup - Slackware program to set up program sets and configure system. Setup devices and file
systems, mount root file system
sh - standard UNIX shell. On Linux, just another name for bash.
shift - promotes each command-line argument. This is a shell builtin.
showmount - show information about an nfs server
shutdown - reboot or shut down system as root, after specified amount of time. With the -r
option, reboot. With the -h option, halt the system.
usage: shutdown -r minutes
The system subtracts x, y and z from the owner, group and other file permissions that it would
otherwise assign to new files. This is a shell builtin.
umount [device] - finish writing to the device and remove it from the active filesystem. The
command umount -a will (re)mount all file systems listed in /etc/fstab.
unalias - remove name previously defined by alias. This is a shell builtin.
uname - displays information about the system. With no arguments, it displays the name of the
operating system. With the -a option, it displays information about the operating system, the
host name, and hardware.
uniq - displays lines of a file that are unique
unset - removes a variable or function. This is a shell builtin.
unzip - uncompress files compressed with the zip utility, compatible with DOS PKzip
updatedb - update file database used by locate command
uptime - shows the time, how long the system has been up, the number of users, and average
load.
useradd - same as adduser
userdel - remove an account (as root). The user's home directory and undelivered mail must be
dealt with separately.
users - prints list of users on the system
vdir - variant of the GNU version of the ls command. Defaults to printing out the long version
of directory entries.
vi - standard screen oriented Unix editor
view - vi in read-only mode
vim - improved vi editor
vrfy - query remote host to verify the accuracy of an email address
w - display info about userids and active processes
wait - waits for a background process to terminate. This is a shell builtin.
wc - displays number of lines, characters and words in a file
Wharf - the AfterStep application dock module
whatis - display one-line summary of specified command
whereis - use to find utilities in standard locations
which - used to find utilities in search path. Will return the absolute directory path of the named
utility program.
who - display information about currently logged in userids
whoami - display information about userid that is currently logged in
wish - front end to tk, an X window extension of tcl
workbone - console based cd player
workman - graphical cd player program
write - send messages to another local user
X - starts up the X server. Can be invoked with
X -quiet -query remotemachineaddress
in order to get a graphical login screen on the remote machine. See the discussion in connection
with xdm below.
xadm - display advanced power management BIOS information
xargs - converts standard output of one command into arguments for another. This is one of
those powerful but obscure commands. Xargs reads arguments from the standard input,
delimited by blanks (which can be protected with double or single quotes or a backslash) or
newlines, and executes the command (default is /bin/echo) one or more times with any initial-
arguments followed by arguments read from standard input. Blank lines on the standard input
are ignored.
xbiff - graphical mail delivery notification utility
xcalc - simple calculator program
xclipboard - name says it all
Xconfigurator - Red Hat utility for configuring settings for X
xdm - used to start an X login session. This can be used to start a login session on a remote
system. After X is configured, X needs to be started at bootup with the command (in
/etc/rc.d/init.d/xterm):
X -quiet -query remotemachineaddress
If the address of a nameserver is not configured, then the numeric address of the remote
machine rather than its name should be entered. If the machines are connected through ethernet
cards and the net, then obviously basic networking has to be set up. Gnome and KDE come with
their own versions of X display/login managers, called respectively gdm and kdm.
xdvi - view a dvi file compiled under LATEX
xedit - a simple text editor for X
xf86config - graphical configuration tool for X
XF86Setup - graphical configuration tool for X
xfd - display an available font in X. Creates a grid in an x-term with one character per rectangle.
xfig - utility for interactive generation of figures
xfm - graphical file manager for X
xhost - tell X server that remote computer has access to your machine and that you will use the
remote computer. This can be used to set up remote X sessions. To set up a remote X session on
the UQAM Nobel machine, run the following command on the local machine (one doesn't have
to be root to do this)
xhost +nobel.si.uqam.ca
Then, log onto the remote machine using rlogin (see above) or telnet. Once logged in, use the
following command to get the remote X server to open an X terminal on the local machine:
setenv DISPLAY localhostname:0 ; xterm &
This is valid for csh, which is the default login shell on Nobel. For ksh, (and I think bash)
replace with
DISPLAY=localhostname:0
export DISPLAY ; xterm
Other X-based programs such as Netscape or Gauss (graphical version) can also be run on a
remote machine with display on the local machine with little trouble. The local X server is the
program that has all of the information concerning the properties of the graphics card and
terminal, so it must be necessary to have X running on the local machine. The following should
also work. After using xhost to give permission to the remote machine to display on the local
machine, use
netscape -display localhostname:0.0
Question: can one start the X session on the local machine and then run a remote copy of a
window manager?
xinit - start X Window. The command startx is a front end to xinit in Linux, including
Slackware.
xload - displays a graphic of the system load
xlpq - graphical interface to print manager. This is included on one of the XFCE menus, but
does not seem to be a part of the base Red Hat distribution.
xlsfonts - list fonts available under the X Window system.
xman - browsable command reference. Displays manual pages under X.
xmh - graphical front end under X to the nmh mail handling system. This program is part of the
XFree86 package in Red Hat.
xmodmap - utility for modifying keymaps and pointer button mappings in X. Can be used to
install a French Canadian keyboard. Download the Xmodmap.cf file from www.linux-
quebec.org, and insert the command
xmodmap /etc/X11/Xmodmap.cf &
into the .xession (with xdm) or the .xinitrc (with startx) file.
xosview - displays bar graphs of system load, load average, memory usage, and swap usage
xpaint - simple paint program for X
xpdf - GPL'd utility for previewing dvi files. Doesn't seem to work too well on texts with a lot
of math.
xplaycd - X Window audio cd player utility
xsetroot - utility to configure root window of an X terminal
xsysinfo - graphical display of load and memory usage
xterm - start an X Window terminal session
xterm-color - color version of xterm
xv - utility for viewing and manipulating many types of image files. This is a shareware
program.
xvidtune - utility for fine tuning of monitor settings under X
yacc - parser generator
ytalk - multi-user program similar to talk
zcat - read one or more files that have been compressed with gzip or compress and write to
standard output
zcmp - read compressed files and pass them to cmp
zdiff - read compressed files and pass them to diff
zgrep - read compressed files and pass them to grep
Zharf - AfterStep button panel module
zip - zip utility compatible with DOS PKzip
zless - view zipped files
zmore - print contents of compressed files one screen at a time
znew - uncompress Z files and recompress in .gz format
Eventually, we want to be able to distinguish between commands that are an intrinsic part of the kernel,
commands that are executable binaries that come with every distribution of Linux, executable binaries
that are not provided with all distributiions of Linux, and executable shell scripts. We also want to
point out the typical location of these commands on different Linux distributions. Finally, we want to
distinguish between shell commands and Linux commands.
9. Notes on Applications
a) Mail Transfer Agents (MTAs)
The Linux distributions I know come with sendmail, except for Mandrake, which as of version 7.1 uses
Postfix as its default MTA. There are several competing programs available. Even the simplest don't
seem to be that easy to configure.
Exim -
Fetchmail - seemingly one of the few ways (Pine is able to do this as well) to download mail
automatically from a POP or IMAP server and pass it to local mail handling agents. Use the
following line in /.fetchmailrc:
poll pop.uqam.ca proto pop3 user USERNAME pass PASSWORD
Use the following to have fetchmail loaded as a daemon that will download mail at regular
intervals:
fetchmail -d 6000
The interval is specified in seconds. Fetchmail will poll all of the pop servers listed
in /.fetchmailrc.
Getmail - Designed as a replacement for Fetchmail.
MMDF -
Postfix - a mail transport agent and potential replacement for sendmail. Mandrake 7.1 and up
uses this as its default MTA.
Qmail - a ``modern'' replacement for sendmail. It is reputed to be more secure than sendmail.
Since it doesn't have a GPL license, it is not the default MTA of any Linux distributions that I
know of.
Sendmail - this one gets my vote for the most complicated and obscure configuration file,
/etc/sendmail.cf. Most individual Linux users will be using machines connected to the Internet
via an ISP or on networks (such as university networks) with centralized mail processing and
access to the net. I have to change the following lines in sendmail.cf to be able to send mail with
emacs.
DMuqam.ca # masquerade the domain name
DNambler.steven # masquerade username
DSnobel.si.uqam.ca # relay all mail through nobel server
The problem comes from the fact that, as a user on a local network, I don't have my own
domain name. I want return mail to be routed to UQAM's mail server and I want the server to
handle all my mail for me, even mail to other UQAM users. If I send mail to UQAM users
using their normalized usernames, the net does not know who or where they are. I have
managed to get a configuration that works by writing a sendmail.mc file and processing it with
the m4 macro interpreter, following the Address-Rewriting mini-HOWTO. I now have
something that works, but which mysteriously complains about ``dangerous write permissions''
every time the system boots up.
Smail - seems to be a popular choice on smaller systems. It would appear that at one point in its
history, Red Hat shipped with smail, but this has been replaced with sendmail.
Zmailer - apparently designed for mail servers with a large number of users.
b) Mail User Agents (MUAs)
Acmemail - Web-based mail agent. Allows you to access your mail with any browser. Involves
setting up a Perl CGI script on the server side.
Archimedes - A successor program to XFmail (see below)
Arrow -
Balsa - the default Gnome mail program
Blitzmail -
Elm -
Emumail - Web-based mail agent. Allows you to use any browser to check your POP mail
account. The Web site of the company that makes this one can be used to check your mail on a
Unix system without setting up any CGI script on the server side.
Evolution - mail reader and contact manager/calendar designed for use under Gnome
Exmh - graphical front end for Mh
Kmail - mail reading program included with KDE
M - for ``Mahogany''. Seems similar to XFmail (see below). I haven't been able to figure out
from the description whether it runs independently of or in conjunction with sendmail and
procmail.
Mh -
Mumail -
Mutt - text based mail program, which is highly configurable.
Nmh - mail handling system. This system includes a large number of binary commands that are
kept in /usr/bin. See the man page for nmh for details. Red Hat 5.1 and 5.2 come with exmh and
xmh, which are graphical front ends for nmh. The exmh front end is a separate package, while
xmh is owned by XFree86.
Pine - text based mail and news utility. Features now include:
MIME support
ability to read and post network news
maintenance of an address book of mail recipients
spell checking during message composition
mouse support when using xterm on an X Window system
a highly configurable environment
Pine can be used to download mail from one or more POP3 mail servers. First, set up multiple
configuration files (pine -p localmail, pine -p popserver 1, pine -p popserver 2, etc.). Then, to
configure Pine to use a POP3 server, use the Setup Config command. Set something like this in
the inbox-path:
{pop.server.com/pop3/user=myid}INBOX
When Pine is restarted, it should ask for your password, connect to the remote server, and use it
is if it were accessing local mail. The article is unclear on whether there is the option of leaving
copies of the downloaded mail on the server.
Sylpheed -
XCmail -
XFmail - This one seems very promising. It's a GUI-based mail tool that seems to offer most of
the features of Netscape's mail module. It runs without using sendmail and procmail, which is a
major advantage.
c) Editors
cooledit - a pretty powerful GUI text editor
emacs - powerful text editor that includes modules for reading and sending mail and postings to
newsgroups, and a browser module. For editing TEX and LATEX files, the AucTEX addon
package is invaluable, and makes emacs pretty hard to beat as an editor with LATEX.
jed - has pretty good emacs emulation (it can even read mail like emacs!). It does simple syntax
highlighting for TeX files, including giving positioning of parentheses. It would seem to be
pretty configurable and takes up much less disk space than emacs, although more than joe and
muemacs. It works well in console mode, and still manages to use colors for menu bars and
syntax highlighting. The program xjed which comes with some versions starts up its own X
terminal when invoked.
joe - "Joe's Own Editor", a fairly powerful editor with a compact binary and an ability to
emulate Wordstar, Emacs, Pico, and a few other editors.
jove - "Joe's Own Version of Emacs". I tried this out a couple of times and managed to crash it
when making some minor errors in command syntax.
microemacs (JASSPA) - spinoff of muemacs. Pretty powerful and configurable, while not
taking up too much disk space or memory.
muemacs - a fairly powerful emacs clone whose binary is actually smaller than that of the Joe
editor.
nedit - an X Window based text editor. Of all text editors for Linux that I've seen, it has
commands which are closest to Windows text editors, for cursor movement, highlighting,
marking text, etc. It has very good syntax highlighting for both LATEX and HTML.
pico - simple text editor. It often comes packaged with the Pine mail user agent.
vi - included with most Linux distributions. If you're not used to the syntax, it can be pretty hard
to understand.
vim - improved version of vi
xedit - simple text editor included with many Linux distributions
d) Other
dfm - Desktop File Manager. Allows the user to place program icons on the desktop.
gmc - Gnome Midnight Commander. Gnome version of Midnight Commander. Includes a
graphical interface and allows the user to place icons on the desktop.
mc - Midnight Commander file manager. Runs in console mode and in an xterm.
scilab - a free matrix programming language. May be a good substitute for GAUSS and/or
MATLAB.