0

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?

1 Answers1

0

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
Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407