LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what are the standard program directories under linux? (https://www.linuxquestions.org/questions/linux-newbie-8/what-are-the-standard-program-directories-under-linux-603113/)

Couling 11-28-2007 06:32 PM

what are the standard program directories under linux?
 
I'm a windows user starting all over again as a linux newby.

Linux seems to have 3 directories for program files:
/bin
/usr/bin
/usr/local/bin

(along with equivalent /lib directories)

I'm a bit confused by what to put where.
Can someone explain the difference in use between these directories.
I'd like to know that I'm putting things in the right place.

Alternatively does anyone know a good resource for directory info like this?

Thanks.

pljvaldez 11-28-2007 06:59 PM

http://tldp.org/LDP/Linux-Filesystem...tml/index.html

There's also /sbin, /usr/sbin, and maybe /usr/local/sbin (not in front of my box to check). Also, when I compile a program from source code, I usually install it to /opt.

rsashok 11-28-2007 07:07 PM

Try this link.

http://www.tuxfiles.org/linuxhelp/linuxdir.html

But in general, if you install a package it will put files in the appropriate directories, and you have little control of where stuff goes. For you personal programs, keep it local somewhere in "/home/your_name/my_programs", and add this directory to the path in ~/.bash_profile.

Couling 11-28-2007 07:14 PM

Quote:

Originally Posted by rsashok (Post 2973931)
For you personal programs, keep it local somewhere in "/home/your_name/my_programs", and add this directory to the path in ~/.bash_profile.

I'll keep t his in mind although I'm installing linux on my laptop, so I find "personal" programs a little hard to define.

Thanks for the links and thanks for your time

reddazz 11-28-2007 08:15 PM

Another good article is available at pathname.com/fhs.

salasi 11-29-2007 06:06 AM

Quote:

Originally Posted by Couling (Post 2973904)
I'm a bit confused by what to put where.
Can someone explain the difference in use between these directories.
I'd like to know that I'm putting things in the right place....

You have received other answers to the question that you have asked, but I'm a little concerned about why you are asking it. If it is for general information, that can only be encouraged, but...

As a relative neophyte, you should be using a distro which makes things easier for you. In my opinion, all of those use a package manager of some kind. There is a bit of a split between the .deb system (Debian and a whole host of derivatives such as the *buntus, Mepis etc) and .rpm system (RedHat, SuSE, Mandriva and derivatives) and a few less popular ones but, the installer/updater system that works with the packages takes care of where you put the program, what libraries it needs and where those libraries need to go.

(The exception to all of this is Slackware and derivatives, and I wouldn't really describe Slackware as a newbie-friendly distro. Has its virtues and has its adherents, of course, but its 'do-it-yourself' style does not make the learning curve any easier for newbies. But, if it happens that you are convinced that Slackware or a derivative is the only thing for you, I'm sure you'll find how-tos and tutorials for your favourite distro which will include exactly these points.)

So, support your local package manger and use locate and/or find if you need to discover where it has put stuff (for general interest). Otherwise, it should just happen.

Couling 11-30-2007 06:29 PM

Yes in the various live cds I've tried I've noticed some big differences in the layout.

In general I was asking becuase I'm insterrested in programming and (at some point) will be looking to write some stuff for linux.

For now tho, it wasa general point of interest rather than an intent to relocate every package.

Thanks for the advice.


All times are GMT -5. The time now is 02:11 AM.