Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the past when I have compiled applications from source I have extracted the source code to ~/src and compiled from there.

I realize now that there may be no need for me to create the ~/src directory, as Linux probably already has an established location for source code for applications such as this.

Is this the case? What is the directory in Linux that is established as the place for source code from third party applications that I want to compile?

share|improve this question
up vote 1 down vote accepted

There's no pre-determined, or even globally preferred, location. The closest analogue I know of would be the /usr/src tree in Red Hat Enterprise Linux and derivatives, but most applications that you compile are designed to be unrolled into their own directories, compiled as a non-privileged user, and only then installed with root privileges.

share|improve this answer
/usr/src isn't specific to RH, it's traditional and specified in the FHS. – Gilles Sep 20 '13 at 22:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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