I'm rather new to the Linux environment and have learned how to install software via using following commands

$ mkdir build
$ cd build 
$ cmake
$ sudo make install.

I noticed that there is a build of the software usually in /build/src and then many of the same files are also in the home directory of the software. There's also an install usually in /usr/local/bin and others. My question is, in an effort to save disk space, what can I delete after I've compiled and installed software in this way? I installed FSlint but afraid to start deleting duplicates. Sorry for this very noob question.

2 Answers 2


don't try to delete anything inside / directory by your self there. In linux file system hierarchy there is

/bin Common programs, shared by the system, the system administrator and the users.

/sbin it contains the executable which requires the root permission to execute

/lib contains the libraries required for the installed programs

/usr Programs, libraries, documentation etc. for all user-related programs.

/usr/bin contains all the programs you have installed and other programs

if you want to get some free space you can do

$ sudo apt-get autoremove
$ sudo apt-get clean

these commands will remove the cached packages and unused packages

After you have finished compiling and installing you can remove the source code of the program and other files in the same directory from where you have compiled the program

  • 2
    Great, good answer +1
    – A.B.
    Jun 18, 2015 at 4:40

the software that you configure, make, make install can generally have the source dirs cleaned up. They should install everything they need as long as the installer was built properly. I'd suggest moving the dir that you compiled in and testing functionality before deleting.

All of that work should be done in a src dir, normally the /usr/src, or even better in the user's home dir create a src.

Now the stuff in the rest of the file system should be the components of an installed package, executables in the bin dirs, data in the etc dirs, the equivelent of dlls in the lib dirs.

here is a link to the wiki page with the basics https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard if you want to know more

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