LINFO

The /sbin Directory


/sbin is a standard subdirectory of the root directory in Linux and other Unix-like operating systems that contains executable (i.e., ready to run) programs. They are mostly administrative tools, that should be made available only to the root (i.e., administrative) user.

The root directory is the top-level directory in the hierarchy of directories on a Unix-like operating systems, i.e., the directory that contains all other directories and their subdirectories as well as all files on the system. In addition to /sbin, other standard subdirectories in the root directory include /bin, /boot, /dev, /etc, /home, /mnt, /proc, /usr and /var.

/sbin is similar to /bin, which contains executable programs needed to boot (i.e., start) the system, except that /sbin's programs are normally executed only by the root user. Thus, /sbin is by default not in the PATH environmental variable of ordinary users, but it is for the root account. PATH lists all directories that the system searches for executable programs, thus eliminating the need to enter the absolute pathnames of programs in commands. Environmental variables are a class of variables that tell the shell how to behave as a user works at the command line (i.e., in all-text mode) or in scripts (i.e., short programs).

Among the more commonly used of the more than 250 programs that are typically in /sbin on Linux systems are fastboot (restart the system without rechecking disks), fdisk (a partition table manipulator), fsck (a filesystem check and repair utility), grub (a Linux boot loader), halt (stop the system), ifconfig (configure a network interface ), klogd (intercepts and logs kernel messages), lilo (a Linux boot loader), mkfs (builds a filesystem), modinfo (display information about a kernel module), reboot (restart the system), route (manipulate the IP routing table), runlevel (reports the runlevel), update (updates an application) and xpeek (shell-type JFS filesystem editor).

A complete list of the contents of /sbin on any system can be seen by using the ls command, which is used to list the contents of directories, as follows:

ls /sbin

System administrative programs that are not required until the /usr filesystem has been mounted (i.e., logically attached to the system) during system startup are usually located in /usr/sbin. Confusingly, some system administration executables may instead reside in /usr/local/sbin.

The sbin in /sbin is short for system binaries. A binary, or binary file, is a type of file that contains some non-text data. Executable files are a type of binary file.




Created June 26, 2005. Updated July 19, 2007.
Copyright © 2005 - 2007 The Linux Information Project. All Rights Reserved.