Basic Linux Tutorial
Computer Tutorial

Binary directories

The Binary ( /bin) Directory

The /bin directory contains binaries for use by all users. According to the FHS the /bin directory should contain /bin/cat and /bin/date (among others).This directory contains user applications and a variety of other things for them, like their source codes, and pictures, docs, or config files they use. /usr is the largest directory on a Linux system, and some people like to have it on a separate partition.

Uniux bin directory structure

Uniux bin directory structure

The System Binary Directory (/sbin)

Most system administration programs are stored in these directories./sbin contains binaries to configure the operating system. Many of the system binaries require root privilege to perform certain tasks. In mamy operating system this directory also contains system scripts required at startup and shutdown time.
This directory also contains subdirectories :
» rc : The rc script that controls all of the system startup and shutdown processes.
» init : It is used to control different system states like single-user mode, multiuser mode, etc.

The /lib Directory

Binaries found in /bin and /sbin often use shared libraries located in /lib. Below is a screenshot of the partial contents of /lib.

The /opt Directory

The purpose of /opt is to store optional software. In many cases this is software from outside the distribution repository. You may find an empty /opt directory on many systems.