Every time I compile software I get a lot of useless files and folders after compiling (junk files )

However I do not know what files to delete because I am afraid it might damage the software.

For example this situation enter image description here

So is there a way to automatically remove junk files after compiling or a way to safely spot junk files and remove them manually

Compiling this particular software


  • Get the official 1.40 source from http://nestopia.sourceforge.net/
  • Unpack it
  • Unpack this overlay over it
  • Go to the directory where you unpacked this and type "make". ("make -j3" for dual-core, "make -j5" for quad).

Before running the emulator, copy the following files to a folder named .nestopia

Please not I have not installed this software.

  • What makes you think any of those files are junk? – Seth Jun 24 '14 at 22:10
  • Well I do not know about this software particular but other software I compiled I took only the binary file out and the software worked without a problem. I believe something here is extra because a NES emulator can not be 187,5 MB the windows version is 2.7 MB sooo – Levan Jun 24 '14 at 22:14
  • 1
    It really depends on the software. Every installation from source is different. – Seth Jun 24 '14 at 22:15
  • 2
    Most of source packages let you remove completely the source directory after you have done a successful make install or equivalent. But in the end, it boils down to each program, so you have to read its documentation. – Rmano Jun 24 '14 at 22:18
  • Thank you very much for the reply, sadly this particular software documentation does not say anything about make install, it only says to use make. so other software that I am going to compile "make install" might do the rick ?? – Levan Jun 24 '14 at 22:30

These files are generated product of your compilation, so they are certainly not junk but the result of your efforts compiling.

Compilation doesn't occur in the same file; out.c compiled code doesn't get written to out.c but to out.o, for example. When you compile something you tell the compiler (more or less):

  1. read this file.
  2. process and link it
  3. write the output here

So, what you are seeing is perfectly normal in most (if not all) languages possible. In your case, you can copy the new files into your system directory (sudo make install or equivalent) and then remove the sources completely, since the original sources are not necessary anymore.

These files can be cleaned (if you want the sources pristine again) with make clean or equivalent.

  • Is there a way that I can avoid make install or "make install" because the documentation only says do "make -j3" for dual-core, "make -j5" for quad – Levan Jun 24 '14 at 22:25
  • @Levan when asking a question it's immensely helpful that you include the guide you are following – Braiam Jun 24 '14 at 22:32
  • I updated the description, but This might be a bad example, I wanted to know in general how to get rid of junk files and this was I think a bad software example that I specified – Levan Jun 24 '14 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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