Tips for Linux Installation/Configuration/Use

Linux directory structure




Primary hierarchy root and root directory of the entire file system hierarchy.


Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.


Boot loader files, e.g., kernels, initrd; often a separate partition.


Essential device interfaces.


Host-specific system-wide configuration files (the name comes from et cetera).


Configuration files for the shell, e.g., Bash.


Configuration files for the X Window System, version 11. xorg.conf lives here.


Configuration files for SSH remote access.


Configuration files for system startup.


Configuration files for /opt/.


Users' home directories containing saved files, personal settings, etc.; often a separate partition.


Libraries essential for the binaries in /bin/ and /sbin/.


Mount points for removable media such as CD-ROMs.


Temporarily mounted filesystems.


Optional application software.


Virtual filesystem documenting kernel and process status as text files, e.g., uptime. In Linux, corresponds to a procfs mount.


Home directory for the root user.


Essential system binaries, e.g., init, route, mount.


Site-specific data which is served by the system.


Temporary files (see also /var/tmp). Often not preserved between system reboots.


Secondary hierarchy for read-only user data; contains the majority of multi-user utilities and applications.


Non-essential command binaries (not needed in single user mode); for all users.


Standard include files.


Libraries for the binaries in /usr/bin/ and /usr/sbin/.


Non-essential system binaries, e.g., daemons for various network services.


Architecture-independent (shared) data.


Source code, e.g., the kernel source code with its header files.


X Window System, Version 11, Release 6.


Tertiary hierarchy for local data, specific to this host. Typically has further subdirectories, e.g., bin/, lib/, share/.


Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files. Sometimes a separate partition.


State information. Persistent data modified by programs as they run, e.g., databases, packaging system metadata, etc.


Lock files. Files keeping track of resources currently in use.


Log files. Various logs.


Users' mailboxes.


Information about the running system since last boot, e.g., currently logged-in users and running daemons.


Spool for tasks waiting to be processed, e.g., print queues and unread mail.


Deprecated location for users' mailboxes.


Temporary files to be preserved between reboots.

The above data was adapted from

Tracing dependencies

ldd <filename>

This produces a list pointing to files that filename is dependent upon. A blank space after a pointer arrow indicates that a crucial file is missing. Google the missing file to see if you can download it.

Reading diagnostics logs


This log could contain diagnostics that indicate why startx didn't work. You can Google these to learn more. /var/dmesg and /var/messages also keep ongoing diagnostics journals that may be helpful in trouble-shooting.


ssh <username>@<hostname>

This command permanently adds the specified host to a list of known hosts and connects you remotely to the host.


scp <username>@<hostname>:<some file on the remote machine> <some file on this machine>

Secure copy. This command copies some file on the remote machine to a location specified on this machine. Also can work the other way:

scp <some local file> <username>@<hostname>:<name at remote machine>

The "-r" option can be used to copy whole directories, as in:

scp mydir

(leaving off the directory or filename after the ":" will just use the same name). Another thing you can do is use IP addresses instead of a hostname. For instance,

scp mydata.txt user@

will copy mydata.txt to the /home/user directory on


xv <filename with extension>

This command opens and displays an image file such as JPEG or GIF over a remote SSH connection. Note: for this to work over an SSH session, you might have to get the "X11 Forwarding" option set up on the SSH client and server.


It's a good idea to create user accounts. Logging in as a user limits the access you have to system files and thus limits the damage you can do to the system. A # prompt indicates you are logged in as root. A $ prompt indicates you are logged in as a user. addusers starts an interactive form that you fill out to create a new user.

Ctrl + Alt + Backspace

Open a command prompt outside of X Windows This combination, done inside X Windows, should terminate X Windows immediately. If it does not, then something in the /etc/X11/xorg.conf file will have to be changed. Also, even inside of X Windows, you might be able to use Ctrl + Alt + F2 and bring up and native console outside of X Windows, then use Crtl + Alt + F7 to return to X Windows; again, whether this is allowed may depend on the setup in the /etc/X11/xorg.conf file.


This command indefinitely switches you from user mode to root mode. To go back to user mode, type exit.


sudo <command>

sudo runs a single command in root mode and immediately returns to user mode. Note: on many systems, this has to be allowed by an administrator first (if you want to run in root mode without a password); there's a "visudo" command that only the root can do, which uses vi to edit a sudoers file with a strange syntax on allowing users to do sudo commands.

Feb4Notes (last edited 2014-05-25 18:15:49 by localhost)