Location of executable files in Linux

6,997

Solution 1

Please note that executables can also be located in /opt//bin and in /opt//sbin. Further, there are often in /usr/libexec also.

Solution 2

Some executables files are stored in /usr/bin (and /usr/sbin). This is usually installed scripts and apps. You should store your own scripts in /usr/local/bin if you want to execute them from the whole system (or /usr/local/sbin). See https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

Share:
6,997

Related videos on Youtube

Suraj Bhatia
Author by

Suraj Bhatia

Updated on September 18, 2022

Comments

  • Suraj Bhatia
    Suraj Bhatia over 1 year

    Besides /bin and /sbin/, which are the other directories in Linux where executable files are stored? I am aware the whereis command is used to find location of the files, but I can't find any other directory besides these two.

    • sawdust
      sawdust about 8 years
      "I can't find any other directory..." -- Apparently you're not aware of the PATH environment variable.
    • Suraj Bhatia
      Suraj Bhatia about 8 years
      Yes, I am, I did check the value of the PATH variable. I got the following value - /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/loca‌​l/sbin:/usr/sbin:/sb‌​in
  • DrMoishe Pippik
    DrMoishe Pippik about 8 years
    Note that you can execute from virtually any location, e.g. Documents, as long as the x bit is set and you have access.