3.4. /bin : Essential user command binaries (for use by all users)

3.4.1. Purpose

/bin contains commands that may be used by both the system administrator and by users, but which are required when no other filesystems are mounted (e.g. in single user mode). It may also contain commands which are used indirectly by scripts. [1]

3.4.2. Requirements

There must be no subdirectories in /bin.

The following commands, or symbolic links to commands, are required in /bin:

CommandDescription
catUtility to concatenate files to standard output
chgrpUtility to change file group ownership
chmodUtility to change file access permissions
chownUtility to change file owner and group
cpUtility to copy files and directories
dateUtility to print or set the system data and time
ddUtility to convert and copy a file
dfUtility to report filesystem disk space usage
dmesgUtility to print or control the kernel message buffer
echoUtility to display a line of text
falseUtility to do nothing, unsuccessfully
hostnameUtility to show or set the system's host name
killUtility to send signals to processes
lnUtility to make links between files
loginUtility to begin a session on the system
lsUtility to list directory contents
mkdirUtility to make directories
mknodUtility to make block or character special files
moreUtility to page through text
mountUtility to mount a filesystem
mvUtility to move/rename files
psUtility to report process status
pwdUtility to print name of current working directory
rmUtility to remove files or directories
rmdirUtility to remove empty directories
sedThe `sed' stream editor
shPOSIX compatible command shell
sttyUtility to change and print terminal line settings
suUtility to change user ID
syncUtility to flush filesystem buffers
trueUtility to do nothing, successfully
umountUtility to unmount file systems
unameUtility to print system information

If /bin/sh is not the POSIX compatible shell command itself, it must be a hard or symbolic link to the real shell command.

The [ and test commands must be placed together in either /bin or /usr/bin.

Rationale

Various shells behave differently when called as sh, so as to preserve POSIX compatibility while allowing changes or extensions to POSIX when desired.

The requirement for the [ and test commands to be included as binaries (even if implemented internally by the shell) is shared with the POSIX.1-2008 standard.

3.4.3. Specific Options

The following programs, or symbolic links to programs, must be in /bin if the corresponding subsystem is installed:

CommandDescription
cshThe C shell (optional)
edThe `ed' editor (optional)
tarThe tar archiving utility (optional)
cpioThe cpio archiving utility (optional)
gzipThe GNU compression utility (optional)
gunzipThe GNU uncompression utility (optional)
zcatThe GNU uncompression utility (optional)
netstatThe network statistics utility (optional)
pingThe ICMP network test utility (optional)

/bin/csh may be a symbolic link to /bin/tcsh or /usr/bin/tcsh.

Rationale

The tar, gzip and cpio commands have been added to make restoration of a system possible (provided that / is intact).

Conversely, if no restoration from the root partition is ever expected, then these binaries might be omitted (e.g., a ROM chip root, mounting /usr through NFS). If restoration of a system is planned through the network, then ftp or tftp (along with everything necessary to get an ftp connection) must be available on the root partition.



[1] Command binaries that are not essential enough to place into /bin must be placed in /usr/bin, instead. Items that are required only by non-root users (the X Window System, chsh, etc.) are generally not essential enough to be placed into the root partition.