中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

Unix/Linux Configuration Files

Configuration files, or config files, are used to configure the initial settings for some computer programs. They are used for user applications, server processes and operating system settings. The files are often written in ASCII (rarely UTF-8) and line-oriented, with lines terminated by a newline or carriage return/line feed pair, depending on the operating system. They may be considered a simple database. Some files are created and modified using an ASCII editor. Others are created and modified as a side-effect of changing settings in a graphical user interface (GUI) program.

Among the Unix variants, there are hundreds of configuration file formats. Each application or service may have a unique format. Historically, Unix operating system settings were often modified only by editing configuration files. Some formats allow entries to be disabled by prepending a special comment character. Unix user applications often create a file or directory in the home directory of the user upon startup. To hide the file or directory from casual listing of the contents of the home directory, the name of the file or directory is prepended with a period, giving rise to the nickname "dotfile" or "dot file". Server processes often use configuration files stored in /etc, but they may also use their installation directory, the root directory, or a location defined by the system administrator.

Configuration files also did more than just modify settings, they often (in the form of an "rc file") ran a set of commands upon startup (ex. a shell rc file might instruct the shell to change directories, run certain programs, delete or create files - many things which did not involve modifying variables in the shell itself and so were not in the shell's dotfiles); according to the Jargon File, this convention is borrowed from "runcom files" on the CTSS operating system. This functionality can and has been extended for programs written in interpreted languages such that the configuration file is actually another program rewriting or extending or customizing the original program.

Frequently used Unix/Linux Configuration Files

profile: System wide environment and startup script program.

/dev/MAKEDEV: The /dev/MAKEDEV file is a script by the system admin for local device files or links to device files for a non-standard device driver.

/etc/aliases: Where the user's name is matched to a nickname for e-mail.

/etc/bootptab: The configuration for the BOOTP server daemon.

/etc/crontab: Lists commands and times to run them for the cron deamon.

/etc/dhcpd.conf: The configuration for the DHCP server daemon.

/etc/ethers: File for RARP mapping from hardware addresses to IP addresses.

/etc/exports: The file describing exported filesystems for NFS services.

/etc/filesystems: Used to set the filesystem probe order when filesystems are mounted with the auto option.

/etc/fstab: Lists the filesystems mounted automatically at startup by the mount -a command (in /etc/rc or equivalent startup file).

/etc/group: Similar to /etc/passwd but for groups rather than users.

/etc/groups: May contain passwords that let a user join a group.

/etc/gshadow: Used to hold the group password and group administrator password information for shadow passwords.

/etc/host.conf: Specifies how host names are resolved.

/etc/hosts: List hosts for name lookup use that are locally required.

/etc/inittab: Configuration file for init, controls startup run levels, determines scripts to start with.

/etc/inetd.conf: Sets up the services that run under the inetd daemon.

/etc/issue: Output by getty before the login prompt. Description or welcoming message.

/etc/issue.net: Output for network logins with LINUX version

/etc/ld.so.conf: Configuration file for ld.so, the run time linker.

/etc/lilo.conf: Configuration file for LILO.

/etc/limits: Limits users resources when a system has shadow passwords installed.

/etc/localtime: In Debian the system time zone is determined by this link.

/etc/login.defs: Sets user login features on systems with shadow passwords.

/etc/logrotate.conf: Configures the logrotate program used for managing logfiles.

/etc/magic: For file types. Contains the descriptions of various file formats for the file command.

/etc/motd: The message of the day, automatically output by a successful login.

/etc/mtab: A list of currently mounted file systems. Setup by boot scripts and updated by the mount command.

/etc/named.conf: Used for domain name servers.

/etc/networks: Lists names and addresses of networks, used by the route command.

/etc/nologin: If this file exists, non-root logins are disabled. Typically it is created when the system is shutting down.

/etc/nsswitch.conf: Name service switch configuration file.

/etc/passwd: Includes username, real name, home directory, encrypted password and other information about each user.

/etc/printcap: A configuration file for printers.

/etc/profile, /etc/cshlogin, /etc/csh/cshrc: Files executed at login or startup time by the Bourne or C shells. These allow the system administrator to set global defaults for all users.

/etc/protocols: Describes DARPA internet protocols available from the TCP/IP subsystem. Maps protocol ID numbers to protocol names.

/etc/rc or /etc/rc.d or /etc/rc?.d: Scripts or directories of scripts to run at startup or when changing run level.

/etc/rc.d/rc.sysinit: Init runs this when it starts.

/etc/resolv.conf: Configures the name resolver, specifying the address of your name server and your domain name.

/etc/securetty: Identifies secure terminals from which root is allowed to log in.

/etc/services: Lists the network services that the system supports.

/etc/shadow: Shadow password file with the encrypted passwords.

/etc/shadow.group: Systems with shadow passwords may have this file.

/etc/shells: Lists trusted shells. The chsh command allows users to change their login shell to shells listed only in this file.

/etc/skel/.profile: Can be used by administrator to set the editor environment variable to some editor that is friendly to new users.

/etc/sudoers: A list of users with special privileges along with the commands they can execute.

/etc/sysconfig/amd: Used to configure the auto mount daemon.

/etc/sysconfig/clock: Used to configure the system clock to Universal or local time and set some other clock parameters.

/etc/sysconfig/init: This file is used to set some terminal characteristics and environment variables.

/etc/sysconfig/keyboard: Used to configure the keyboard.

/etc/sysconfig/mouse: This file is used to configure the mouse.

/etc/sysconfig/network-scripts/ifcfg-interface: Defines a network interface.

/etc/sysconfig/routed: Sets up dynamic routing policies.

/etc/sysconfig/static-routes: Configures static routes on a network.

/etc/syslog.conf: Configuration file for the syslogd daemon.

/etc/termcap: The terminal capability database.

/etc/terminfo: Details for terminal I/O.

/etc/usertty: This file is used to impose special access restrictions on users.

$HOME/. profile: Users environment stuff and startup programs.

$HOME/. logout: User actions to be done at logout.

$HOME/.htaccess : Provides a way to make configuration changes on a per-directory basis.

$HOME/.hushlogin: Prevents check for mail, printing of the last login time, and the message of the day when the user logs in.

$HOME/.inputrc: Contains keybindings and other bits.

$HOME/Xrootenv.0: Has networking and environment info.

/proc/cpuinfo: Information about the processor such as its type, make and performance.

/proc/devices: A list of devices configured into the currently running kernel.

/proc/dma: Shows which DMA channels are being used at the moment.

/proc/ioports: Shows which I/O ports are in use at the moment.

/proc/interrupts: Shows which interrupts are in use and how many of each there has been.

/proc/kcore: An image of the physical memory of the system.

/proc/kmsg: Messages output by the kernel. These are also routed to syslog.

/proc/ksyms: Symbol table for the kernel.

/proc/loadavg: The load average of the system.

/proc/meminfo: Information about memory usage, both physical and swap.

/proc/modules: Which kernel modules are currently loaded.

/proc/mounts: Contains information on filesystems currently mounted, similar to /etc/mtab

/proc/net: Contains status information about network protocols.

/proc/self: A symbolic link to the process directory of the program that is looking at /proc. When 2 process look at proc, they get different links.

/proc/stat: Various statistics about the system such as the number of page faults since the system was booted.

/proc/uptime: The time the system has been up.

/proc/version: The kernel version.

/usr/lib/zoneinfo: Time zone datafiles are stored here on the Debian system

/var/log/lastlog: Used by finger to tell when a user was last logged in.

/var/log/wtmp: Binary info on users that have been logged on. The last command uses this info.

/var/run/utmp: Contains information about users currently logged in. Who and w commands use this file.

/var/named/*: Files used by domain name server. Placed here optionally, but this is the normal location.

/var/log/btmp: Used to store information about failed logins. This file must be first created to activate it.

/var/log/lastlog: Contains information about the last time a login was done on the system. Works with lastb.

/var/log/maillog: The normal system mail log file.

/var/log/messages: The main system message log file.

var/log/secure: System tracking of user logins. Check this file periodically.

/var/spool/mail: Where mailboxes are usually stored.