Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I know that when I install a program from source is possible to make it run in terminal only by typing its name using these two ways

  1. copy executable file from home directory to /usr/local/bin.
  2. add its path to the PATH in ~/.bashrc file.

Which file (or better to say which type of file) from home directory I should add to /usr/local/bin? Please do not tell me just executable! I saw a lot of executable files in my home/myprogram directory with this command:

find . -perm -u+x -type f

from How to find executables. Also there is a file named myprogram. Should I add this to /usr/local/bin?

share|improve this question

closed as unclear what you're asking by precise, i08in, guntbert, Eric Carvalho, Braiam Mar 31 at 0:49

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
alex what is the question? How is this different from your previous qestion? –  precise Mar 30 at 7:13
    
@rusty I try to edit :-D –  lion Mar 30 at 7:15
    
what's the "program directory"? what file are you trying to copy, why? (what are you trying to achieve?) –  precise Mar 30 at 7:21
2  
I think the package should have some script like configure or something to make such things easy for you.. check this link: installing from source –  precise Mar 30 at 7:29
2  
Usually you build and install from sources like this: ./configure && make && sudo make install. Make install copies the files for you to correct locations. If you need to manually copy files, then something is not right. –  user205301 Mar 30 at 7:41

1 Answer 1

up vote 0 down vote accepted

Whatever you try to do or to archive, please try as much as possible to not add your executable files in a system directory like /usr/local/bin. This can be unpleasant for other users who use the same system.

You can put your executable files in your ~/bin directory. If you don't have already one, create it:

mkdir -p ~/bin

This directory is already added to your PATH as you can see in the last lines from your ~/.profile file. So, any executable that you put there can be run only by typing it's name.

And which file to add? - Any file you want, nobody (other than you) and nothing will be disturbed because of this.

In case of a program installed from sources you better create a symbolic link to the executable file which starts the program, instead to copy the executable file:

ln -s /path/to/program/executable_file ~/bin
share|improve this answer
    
thanks :-) that is working –  lion Mar 31 at 21:17
    
by asking this askubuntu.com/questions/453086/difference-between-root-and-home now I understand why you say ~/bin –  lion Apr 22 at 19:15

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