LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-17-2007, 07:41 AM   #1
jpostma
Member
 
Registered: Jun 2003
Location: Alphen ad Rijn -- The Netherlands
Distribution: Fedora Core 2 - Slackware 12
Posts: 119

Rep: Reputation: 15
Difference between /usr and /usr/local


What is the difference between /usr and /usr/local?

Johannes
 
Old 07-17-2007, 08:09 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by jpostma
What is the difference between /usr and /usr/local?

Johannes
What is the context of this question?

The /usr directory is generally for applications and related data of interest to the users--as opposed to maybe the system administrator. /usr/local is a subdirectory within that--on my system, it does not have much in it.

Much of the filesystem setup traces back to Unix and, for most users, has no practical meaning. Nonetheless, the conventions get followed to make life easier for system admins, developers, etc.

Go to tldp.org and look for the "Filesystem Hierarchy Standard"
 
Old 07-17-2007, 09:05 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
The /usr directory contains its own hierarchy which is similar to the root hierarchy. The /bin and /sbin directories will contain the basic commands needed to boot, run and administer the machine. When you add a package, it usually will install under the /usr hierarchy. Suppose that you want to compile your own software. It isn't something that is provided by the distro, and you would like to protect it from being altered during an upgrade or reinstall. The /usr/local hierarchy won't be touched by the distro.

Many tarballed packages will use /usr however. Often /usr/local/bin isn't added to the PATH.

In a heterogeneous network, where each host runs the same Linux distro, you might have have /bin, /sbin/, /lib, /usr, /opt and other directories mounted read-only. Instead of a local partition, an NFS share is mounted. In such an environment, the /usr/local directory may have a local partition mounted to allow you to install software with the base directory of /usr/local.

If you take any source package using autoconf, and run ./configure --help, you will see this option:
Code:
Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
"./configure --prefix" will create a Makefile that will install the binary in /usr/local/bin, the libraries in /usr/local/lib, the manpage in /usr/local/man, etc.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is difference between /usr/sbin/ps & /usr/ucb/ps command rajaniyer123 Solaris / OpenSolaris 6 07-05-2007 01:53 PM
making files available in /usr/local/bin and /usr/sbin reakinator Linux - Newbie 1 10-14-2006 06:09 PM
./configure --prefix=/usr [default: /usr/local] why??? stevesk Slackware 14 07-03-2006 07:28 AM
Installing software, /usr/lib directory and /usr/local millertime Linux - Software 2 07-10-2004 10:21 AM
Difference between /usr/ and /usr/local/ ? MDesigner Linux - Newbie 7 07-04-2004 10:37 AM


All times are GMT -5. The time now is 04:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration