Difference Between bin and sbin

Ever been curious about the difference between bin and sbin? The ‘s’ in sbin means ‘system’. Therefore, system binaries reside in sbin directories.

As you may have noticed, there are a number of different bin directories in Linux. The best reference I’ve found for an understanding of various Linux folders is man hier. It provides a brief explanation of the Filesystem Hierarchy Standard (FHS) in Linux. I’ve included a summary of the various bin and sbin definitions below:

    This directory contains executable programs which are needed
    in single user mode and to bring the system up or repair it.

    Like /bin, this directory holds commands needed to boot the 
    system, but which are usually not executed by normal users.

    This is the primary directory for executable programs. Most
    programs executed by normal users which are not needed for 
    booting or for repairing the system and which are not
    installed locally should be placed in this directory.

    This is where programs which are local to the site typically

    Binaries for programs local to the site.

    Locally installed programs for system administration.

If you want to create your own scripts and make them available to all users, you’re pretty safe adding them to /usr/local/bin. If you want to run scripts using cron or crontab, simply use the full path to the command (i.e. /home/user/command).

What I do is add my scripts to my local bin (~/bin) and then I create a symbolic link in /usr/local/bin to the commands I want to make public. As a result, I can manage all my scripts from the same directory but still make some of them publicly available since /usr/local/bin is added to $PATH.


    1. $PATH is a list of locations that the system checks in order to run applications. So if you run composer from anywhere the system checks the PATH environment variable to see if it knows where the programme is. If its not in the path and you are not running it from the location where its able to be executed then it wont run. echo $PATH to see your path.


  1. According to this article, /usr/local and /usr/local/bin are the same thing. This article writer doesn’t appear to have the capacity to explain things very well.


Comments, questions and feedback welcome.

This site uses Akismet to reduce spam. Learn how your comment data is processed.