Chapter 8. Finding Things on a Linux system

Table of Contents
Directory structure on a Linux system
Programs for finding files
Programs for finding people

Modern computing systems, including Linux, typically contain tens of thousands of files or more. It can be easy to lose something of value among all of these files, whether you are a beginner or an advanced user. Luckily, there are conventions for standard file locations that can give you hints about where to begin a search. There are also powerful programs for searching the filesystem.

Directory structure on a Linux system

Many of the files on a Linux system go in specific locations. For example, you will find most installed software in the /usr (pronounced ``user'') directory. In particular, most Linux distributions install their software in this directory. Under /usr there are directories for various parts of applications. Executable programs (the part that you would run) are often referred to as binaries, and can be found in /usr/bin. The ``man'' pages, containing online manuals are found in /usr/man, and so on.

By convention, applications that were not pre-packaged with your Linux distribution are stored in /usr/local, so they do not conflict with other programs. Like /usr, it is subdivided into /usr/local/bin, /usr/local/man, and so forth.

Hint: Although Linux beginners are usually aware that there are hundreds of commands that they might type in their shell, they often don't know the names of many commands. One very enlightening way to learn about the commands on a system is to peruse the /bin, /usr/bin, and /usr/local/bin directories (a la ls /bin | less). Type man command to read the manual page about each command and learn what it does.

Other directories that will be of interest are /etc (pronounced ``et-see'') where configuration information is kept for many programs, /tmp (``temp'') where temporary files may be placed, and /mnt (``mount'') where new filesystems are attached (mounted). Unread email and files that are in the process of being printed are both stored in /var, as are the system logs and other files which change frequently.

The /home directory is where personal files are stored. The typical place for a user's home directory is named after their login account, /home/user, although this may differ from system to system. You can learn the location of your home directory by printing the $HOME variable.

Example 8-1. Printing the home directory


$ echo $HOME
/home/ldap/dbindner