After entering into root mode in /usr, I found the following directories.

swapnil@swapnil-Inspiron-3541:~$ sudo su
[sudo] password for swapnil:
root@swapnil-Inspiron-3541:/home/swapnil# cd /usr
root@swapnil-Inspiron-3541:/usr# ls
bin  games  include  lib  local  locale  sbin  share  src

I know the difference between bin and sbin but need help with local and locale.

  • local means you local machine - files related to current machine only. locale means its related to your locale (geographical region) which include language, currency symbols etc. but may contain locate related files to other regions you interact with... – guiverc Sep 14 '17 at 23:59

In distributions like Ubuntu, /usr is where packages are supposed to install stuff and /usr/local is where the system administrator can install stuff outside the packaging system. From the Filesystem Hierarchy Standard:

The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable amongst a group of hosts, but not found in /usr.

Locally installed software must be placed within /usr/local rather than /usr unless it is being installed to replace or upgrade software in /usr.

/usr/locale seems to be a mistake in packaging. It contains translations of text used by some Unity lenses, but those are supposed to go in /usr/share. For example, here's the directory structure of /usr/locale:

~ find /usr/locale
/usr/locale
/usr/locale/da
/usr/locale/da/LC_MESSAGES
/usr/locale/da/LC_MESSAGES/unity-lens-files.mo
/usr/locale/da/LC_MESSAGES/unity-lens-applications.mo

And in /usr/share/locale, one will find hundreds of such files:

$ find /usr/share/locale | head
/usr/share/locale
/usr/share/locale/tig
/usr/share/locale/tig/LC_MESSAGES
/usr/share/locale/tig/LC_MESSAGES/iso_639_3.mo
/usr/share/locale/tig/LC_MESSAGES/iso_3166.mo
/usr/share/locale/tig/LC_MESSAGES/iso_639.mo
/usr/share/locale/hsb
/usr/share/locale/hsb/kf5_entry.desktop
/usr/share/locale/hsb/LC_MESSAGES
/usr/share/locale/hsb/LC_MESSAGES/kjobwidgets5_qt.qm

Packages are not supposed to create more directories in the top level of /usr. This seems to be a harmless bug. You may report it if you feel like it.

local means you local machine - files related to current machine only. you'll find a /usr/local/bin/ for local [company, employer|org etc] bins (not system or distro-releated installed which go in /bin or /sbin usually) but there may not be much there [esp. if a home pc]

locale means its related to your locale (geographical region) which include language, currency symbols etc. but may contain locate related files to other regions you interact with... if you want to see info that applies; enter the locale command and you'll get something like

LANG=en_AU.UTF-8 
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME="en_AU.UTF-8"
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY="en_AU.UTF-8"
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER="en_AU.UTF-8"
LC_NAME="en_AU.UTF-8"
LC_ADDRESS="en_AU.UTF-8"
LC_TELEPHONE="en_AU.UTF-8"
LC_MEASUREMENT="en_AU.UTF-8"
LC_IDENTIFICATION="en_AU.UTF-8"
LC_ALL=
  • I suggest editing to clarify what "files related to current machine only" means. I thought I understood, but then you said most system-installed executables--I presume this is what you mean by "bins"--usually go in /bin or /sbin. But most executables in a default installation of Ubuntu, and the vast majority that are available through Ubuntu's package manager, go in /usr/bin (with some in /usr/sbin). For example, my Lubuntu 16.04 LTS system has 3550 files in /usr/bin, but only 277 in /bin. I don't know if you meant to mention those directories so I haven't done the edit myself. – Eliah Kagan Sep 15 '17 at 6:07

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.