Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 








Important Files and Directories

Linux Tips by Burleson Consulting

Armed with knowledge about how to navigate the Linux directory tree and manipulate files, we'll now look at some of the more important files within Linux.  This chapter will also provide information on how to identify some of the standard directories created within the Linux directory architecture and where important files are stored within the structure.

Home Directory

Each Linux user is assigned a home directory where they can keep files and build upon the structure by creating their own directories.  The user home directories are identified by the Linux login user name and can usually be found under a parent directory called /home.  If the users on the server are sally, bill, joan, and fred, the home directory structure would be like the one demonstrated below.

            ? /bill
            ? /fred
            ?  /joan
            ? /sally

We mentioned earlier that every Linux system has a root user but we do not see a home directory for root here.  Since root is a special user, root?s home directory can be found by itself at /root.

Hidden ?Dot? Files

There are some files within the home directory that are ordinarily hidden.  Hidden files have names that begin with a period; hence, they have been given the nickname of dot files.  Hidden files are not displayed by the ls command unless the ?a option is used in the format of ls ?a.

Table 5.1 below lists some of the more common dot files that users should know about.  This is by no means a totally comprehensive list.  Additional dot files can be found in the user?s home directory; however, some searches may not find some of the files listed here.  The files found are dependent upon the applications installed on the server, the utilities that are in use and the command shell that is being used.  Since the default shell for Linux is the bash shell, the home directory contains the bash related scripts indicated below.

File Description


For users of the bash shell, a file containing up to 500 of the most recent commands available for recall using the up and down arrow keys.


Script that is run by the bash shell when the user logs out of the system


Initialization script that is run by the bash shell upon login in order to setup variables and aliases.  When bash is started as the default login shell, it looks for the .bash_profile file in the user?s home directory; if not found, it looks for .bash_login.  If there is no .bash_login file, it then looks for a .profile file.


Initialization script executed whenever the bash shell is started in some way other than a login shell. It is better to put system-wide functions and aliases in /etc/bashrc, which will be presented later in the book.


GTK initialization file.  GTK+ is a multi-platform toolkit for creating graphical user interfaces, used by a large number of applications.  It is the toolkit used by the GNU project's GNOME desktop.


The initialization script that is run whenever a user login occurs.


The script that is automatically run whenever a user logout occurs.


Put default system-wide environment variables in /etc/profile.


Initialization file for the Vim text editor that is compatible with vi.


Specifys the default window manager if one is not specified in startx

.Xdefaults & .Xresources

Initialization files for Xterm resources for the user. Application program behavior can be changed by modifying these files.


The initialization file used when running startx, which can be used to activate applications and run a particular window manager.


This file is executed when a user logs in to an X-terminal and is used to automatically load the window manager and applications.

Table 5.1: Common dot files for the bash shell

When these files do not exist in the user?s home directory, programs that use the files will often use a global default configuration file installed in one of the subdirectories in which the package is installed.

The list below indicates the dot files installed in tclark?s home directory.

-rw-------    1 tclark   tclark       3773 Jan 13 21:39 .bash_history
-rw-r--r--    1 tclark   tclark         24 Aug 18 11:23 .bash_logout
-rw-r--r--    1 tclark   tclark        191 Aug 18 11:23 .bash_profile
-rw-r--r--    1 tclark   tclark        124 Aug 18 11:23 .bashrc
-rw-r--r--    1 tclark   tclark        237 May 22  2003 .emacs
-rw-r--r--    1 tclark   tclark        120 Aug 24 06:44 .gtkrc
-rw-------    1 tclark   tclark        692 Jan 13 21:35 .viminfo
-rw-r--r--    1 tclark   tclark        220 Nov 27  2002 .zshrc

The following is the content of the .bash_logout file in tclark?s home directory, which is executed whenever logging out of the system.  It does nothing more than clear the screen upon logout.

# ~/.bash_logout


The following is the content of the .bashrc file from tclark?s home directory.  Shell scripts will be presented in a later chapter, but for now suffice it to say that the script looks for a file in the /etc directory called bashrc and execute it if the file exists.

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc

These files primarily affect individual users on the Linux system.  Next we'll look at the files which affect the entire system.

Important System Files

Everything in the Linux environment exists in files.  It makes sense for users to become familiar with some of the more important Linux system files.  Some of these are configuration files, others are devices which Linux makes available through files and some are executable programs.

Table 5.2 below is by no means intended to be an exhaustive list of Linux system files; however, it is a good representation to give some insight into the inner workings of Linux.




The Linux kernel file.  File naming conventions may include release information


Device file for the first floppy disk drive on the system


Device driver for the first floppy drive in high density mode, commonly invoked when formatting a floppy diskette for that density


Device file for the first IDE hard drive on the system


Commonly, the IDE CDROM drive device file which often is a symbolic link called to /dev/cdrom, the real CDROM driver file.


A dummy device which contains nothing.  It is sometimes useful to send output to this device to make it go away forever.


Contains aliases used by sendmail and other mail transport agents. Whenever this file is changed, the newaliases utility must be run to notify sendmail of the changes


Contains global defaults and aliases used by the bash shell


A parent shell script to run commands periodically.  It invokes hourly, daily, weekly, and monthly scripts.


Contains a list of filesystems which may be made available to other systems on the network via NFS.


The file system table contains the description of what disk devices are available at what mount points.


Holds information regarding security group definitions.


The grub boot loader configuration file


Contains host names and their corresponding IP addresses used for name resolution whenever a DNS server is unavailable


Contains a list of hosts allowed to access services on this computer.


Contains a list of hosts forbidden to access services on this computer.


Describes how the INIT process should set up the system in various runlevels


Contains the pre-login message, often overwritten by the /etc/rc.d/rc.local script in Red Hat and some other rpm-based Linux distributions


The lilo boot loader configuration file


Holds options for configurable system modules


This is the ?message of the day? file which is printed upon login. It can be overwritten by /etc/rc.d/rc.local Red Hat on startup.


Status information for currently mounted devices and partitions


Contains information regarding registered system users. Passwords are typically kept in a shadow file for better security.


Holds printer setup information


Contains global defaults for the bash shell


A list of domain name servers (DNS) used by the local machine


This file contains a list of terminals where root can login


An extensive ASCII text file defining the properties of consoles, terminals, and printers


Contains CPU related information


Holds information regarding filesystems that are currently in use


Stores the interrupts that are currently being used


A list of the I/O addresses used by devices connected to the server


Contains memory usage information for both physical memory and swap


Lists currently loaded kernel modules


Displays currently mounted file systems


Contains various statistics about the system, such as the number of page faults since the system was last booted


Holds swap file utilization information


Contains Linux version information


Stores information about the last boot process


Contains messages produced by the syslog daemon during the boot process


A binary data file holding login time and duration for each user currently on the system

 Table 5.2: Representative list of Linux files

Now let's look at the contents of some files from tclark?s server.  Since these files contain variable information, do not expect the files on every server to look exactly like these.

The following is part of the file /etc/passwd.  The second field has an x as a placeholder for the password.  This indicates that the passwords for each user are being kept in a shadow file.


# cat /etc/passwd

ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin



sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
oracle:x:500:501:Oracle Software Owner:/home/oracle:/bin/bash
tclark:x:503:504:Terry Clark:/home/tclark:/bin/bash

The fields in this file are separated by colons.  In order the fields are username, password (or placeholder), user ID number, primary group ID number, user's full name, user's home directory and user's default shell.

The file system table, /etc/fstab, defines parameters for mounting partitions and devices as filesystems.  The fields displayed below indicated the device or filesystem to be mounted, the mount point, the type of filesystem, the mount options, dump option, and file check order at boot time.


# cat /etc/fstab
/dev/md0                /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
LABEL=/bootback         /bootback               ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hdd1               swap                    swap    defaults        0 0
/dev/hdc1               swap                    swap    defaults        0 0
/dev/hdb3               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0

The /proc/meminfo file contains real and virtual memory usage statistics.


# cat /proc/meminfo
        total:    used:    free:  shared: buffers:  cached:

Mem:  2107744256 2088869888 18874368        0 180436992 1587232768
Swap: 1508102144 13074432 1495027712
MemTotal:      2058344 kB
MemFree:         18432 kB
MemShared:           0 kB
Buffers:        176208 kB
Cached:        1544780 kB
SwapCached:       5252 kB
Active:        1391876 kB
ActiveAnon:     790712 kB
ActiveCache:    601164 kB
Inact_dirty:    437124 kB
Inact_laundry:   90216 kB
Inact_clean:     41596 kB
Inact_target:   392160 kB
HighTotal:     1179328 kB
HighFree:         5588 kB
LowTotal:       879016 kB
LowFree:         12844 kB
SwapTotal:     1472756 kB
SwapFree:      1459988 kB
Committed_AS:  1565668 kB
HugePages_Total:     0
HugePages_Free:      0
Hugepagesize:     4096 kB

Next we'll look at some of the significant directories on the Linux system.  Some of these will be familiar as the location of the files we've just looked at.

Important Directories

Although organizations have made strides toward consistency via standards such as the Linux Filesystem Hierarchy Standard (FHS), different Linux distributions still have somewhat different directory structures.  The following rendering exemplifies a typical Red Hat effort toward standardization of where files are stored according to type and use.




All binaries needed for the boot process and to run the system in single-user mode, including essential commands such as cd, ls, etc.


Holds files used during the boot process along with the Linux kernel itself


Contains device files for all hardware devices on the system


Files used by application subsystems such as mail, the Oracle database, etc.


Contains various service startup scripts


Holds application setup scripts run by /etc/profile upon login


Contains subdirectories which contain run level specific scripts


run level initialization scripts


Where ??? is a number corresponding to the default run level. Contains symbolic links to scripts which are in /etc/rc.d/init.d. for services to be started and stopped at the indicated run level.


Holds example dot files used to populate a new user's home directory.


Contains subdirectories and configuration files for the X Window system


User home directories


Some shared library directories, files, and links


The typical mount point for the user-mountable devices such as floppy drives and CDROM


Virtual file system that provides system statistics.  It doesn't contain real files but provides an interface to runtime system information.


Home directory for the root user


Commands used by the super user for system administrative functions


A standard repository for temporary files created by applications and users.


Directory contains subdirectories with source code, programs, libraries, documentation, etc.


Contains commands available to normal users


X Window system  binaries


Holds include files used in C programs


Contains shared directories for man files, info files, etc.


Library files searched by the linker when programs are compiled


Common executable application files local to this system


Commands used by the super user for system administrative functions


Administrative files such as log files, locks, spool files, and temporary files used by various utilities

The contents of these directories will vary from system to system but most of these directories will typically be present.  Often when you install software or a new device on a Linux system files will be added or modified in these directories to make everything work.

This is an excerpt from "Easy Linux Commands" by Linux guru Jon Emmons.  You can purchase it for only $19.95 (30%-off) at this link.

How is Linux Structured?

Linux distributions are based on two parts: the kernel (and kernel modules) and RPM packages (for Redhat-like distributions). When an installation of Linux is performed, choose all the necessary packages that will be present on the server. A Linux package can be composed of source codes, patches, configuration files, manuals or binaries. A RPM (Redhat Package Manager) package can be built from source files or patches. Oracle requires specific RPM packages to be installed in order to perform an installation of the Oracle software. Those requirements will be covered in Chapter 6, Preparing Linux for Oracle.


<  The Linux directory structure

/          Root (starting point of your directory structure)

|---root          Home reserved for root user

|---etc           Configuration files specific to the machine.

|---etc/inittab   describes processes to be started /stopped

|---etc/fstab     descriptive information about the file systems

|   and their mount points

|---etc/passwd    contains information for user account


|---home          Contains the user's home directories

|---bin           Commands needed during start-up

|---sbin          Commands run by system administrators

|---proc          This mount point is virtual

|---usr    Contains all commands, libraries, man pages and

|   static files

|---usr/doc              Documentation for the user apps

|---usr/src               Code sources files for the system's software,

|   contains also Linux kernel

|---usr/include   Header files for the C compiler

|---usr/X11R6     X Window System directory


|---boot          Files used during boot, LILO (vmlinuz Kernel

|                 images can be stored).

|---lib           Shared libraries needed by the programs on the

|                 root filesystem

|---dev           Device files for devices such as disk drives,

|                 serial ports, etc.


|---var           Contains files that change for mail, log files,

|                 man pages, temp files

|---mnt           Mount points for temporary mounts by the system

|                 administrator.

|---tmp           Temporary files.

|---lost+found    Contains files to restores after a system crash

|                 or partition not un-mounted before a system

|                 shutdown




Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational