Some Useful Linux Commands

Steve Ambler

February 2002

Contents

1  Introduction
2  Shorthand at the Command Prompt
3  Typical Dot Files
4  Useful Files
5  Important Directories
6  Important Bash Shell Variables
7  Important Daemons and Startup Services
8  Window Managers
9  Alphabetical List of Principal Commands
10  Notes on Applications
    10.1  Mail Transfer Agents (MTAs)
    10.2  Mail User Agents (MUAs)
    10.3  Editors
    10.4  Other
11  Some Nifty Slogans
12  References

1  Introduction

This is my own summary of useful Linux abbreviations, directories, files, and commands. I use my own annotations to recall useful options and arguments that are not necessarily documented in easy-to-find places. I quite often call up this file when I can't remember the syntax of a command that I use often (but not often enough to remember the syntax!). I also editorialize on the relative usefulness of different types of programs.

This document is work in progress. Send suggested changes and corrections to ambler.steven@uqam.ca

O'Reilly has just published online an alphabetical list of commands from Linux in a Nutshell. It is available here. It contains more detailed explanations of many of the commands listed here.

2  Shorthand at the Command Prompt

Some of these are specific to the bash shell. I have not experimented enough with other shells to know which are common to all shells. See also the ``Bash Reference Card'', SSC (2000), available online.

3  Typical Dot Files

There is some redundancy across these programs. For example, the look and behavior of emacs can be customized by usinng the .emacs file, but also by adding the appropriate modifications to the .Xdefaults file. Default versions of these files are often installed in users' home directories when the software packages that use them are installed. If a program doesn't find its configuration file in the user's home directory, it will often fall back on a sytem-wide default configuration file installed in one of the subdirectories that the package lives in.

4  Useful Files

5  Important Directories

Different distributions have different directory structures, despite attempts at standardization such as the the Linux Filesystem Hierarchy Standard (FHS) organization.

6  Important Bash Shell Variables

These variables are most often inherited or declared when a shell is started. A great reference for bash shell variable, bash builtin commands, and bash in general is SSC (2000).

7  Important Daemons and Startup Services

These are programs or processes which are run at boot time. Some remain in memory to execute various tasks when required (daemons). Most are started and stopped with scripts in the /etc/rc.d/init.d directory (see above). The exact contents of this directory will depend on which packages from a particular distribution are installed. For example, installing the Apache package will cause an httpd script to be placed in /etc/rc.d/init.d.

There are man pages on most of these. The Red Hat program tksysv (ntsysv is the non graphical version) allows root to automatically configure which of these are started automatically at boot time. The linuxconf program does the same thing, although I haven't tried it. The utility chkconfig is also designed to query and configure runtime services for different runlevels. The www.mandrakeuser.org site has a good page on common services/daemons, especially those included in recent versions of the Mandrake distribution.

A good source of information on daemons and services is the ``Linux Devices, Daemons, Services'' chapter of the CTDP (2000a) document.

8  Window Managers

The ``Window Managers for X'' site is extremely useful for keeping track of new Linux window managers. See http://winman.org.

9  Alphabetical List of Principal Commands

In the following command list, the distinction between upper case and lower case letters is important. Most of the commands are utilities that are run by invoking their own executable files. In some cases, they are commands which are internal to a shell such as bash (shell builtins). The shell builtins are indicated. There are now many utilities that are included with either the Gnome or the KDE desktop environments, so many that it would be difficult to include them all here. In many cases, they duplicate the functionality of one or more of the programs listed below. I would suggest consulting the online documentation for these packages.

Another good source of information on commands is the CTDP (2000b) document. There are different chapters which group commands in different categories.

On rpm-based systems, to find out which package owns the command foo (where foo is a standalone executable), use the command rpm -q -f foo.

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.

10  Notes on Applications

10.1  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.

10.2  Mail User Agents (MUAs)

10.3  Editors

10.4  Other

11  Some Nifty Slogans

Linux: the choice of a GNU generation.

Windows: where do you want to go today? Linux: where do you want to go tomorrow?

This program has performed an illegal operation and will be shut down: please reboot using Linux.

``When you say `I wrote a program that crashed Windows', people just stare at you blankly and say `Hey, I got those with the system, for free'.'' - Linus Torvalds

Windows 2000, from the company that brought you EDLIN!

Linux: because rebooting is for adding new hardware.

Your mouse has moved. Windows NT must be restarted for the change to take effect. Reboot now [OK]?

Linux: transforms your microcomputer into a workstation. Windows NT: transforms your workstation into a microcomputer.

12  References

Computer Technology Documentation Project (CTDP) (2000a), ``How Linux Works'', http://ctdp.tripod.com/os/linux/howlinuxworks/index.html

Computer Technology Documentation Project (CTDP) (2000b), ``Linux Files and Command Reference'', http://ctdp.tripod.com/os/linux/commands/index.html

Klimas, Piotr et. al. (1999), ``Linux Newbie Administrator Guide'', http://sunsite.dk/linux-newbie/

Siever, Ellen, Stephen Spainhour, Jessica P. Hekman, and Stephen Figgins (2000), Linux in a Nutshell. third edition, O'Reilly

Sobell, Mark G. (1998), A Practical Guide to Linux. Addison-Wesley

SSC (2000), ``Bash Reference Card'', http://www.ssc.com/ssc/bash/ bash.pdf

Welsh, Matt, Matthias Kalle Dalheimer and Lar Kaufman (1999), Running Linux. third edition, O'Reilly and Associates




last modified: (21/03/02)




File translated from TEX by TTH, version 2.73.
On 21 Mar 2002, 07:57.