Is it possible to give "out-of-the-box" programs an executable command in Linux?

1

1

I don't know if I'm being clear. Take the following scenario:

You have downloaded a .tar.gz compressed program, you unpack it, and it runs right from there. It's not source code, just an application that doesn't need an installation to run.

Let's say I want this application (let's call it ProgramZ) to run with a terminal command programz (or Alt+F2, whatever, ) from any directory in my Linux box.

Is that even possible? Do I have to copy the executable to /bin? If so, is that enough? If not, how do I properly do it without risking my system's stability?

Thanks!

gchiconi

Posted 2014-01-26T02:37:56.403

Reputation: 145

Answers

2

It is not required to copy the file to /bin directory. You may either copy it into the /usr/bin directory or create a symlink like so ln -s /path/to/exec /usr/bin/progname. You might need to use sudo according to your configuration. Symbolic linking is better under most of the circumstances. And don't forget to chmod +x progfile to make it executable.

Gaurav Joseph

Posted 2014-01-26T02:37:56.403

Reputation: 1 503

0

Usually you have to give the full path to run something.

If the executable/binary (what you call "out-of-the-box") prg is located in /home/bla/ you say /home/bla/prg.

Or if you already are in /home/bla you have to say ./prg (unless /home/bla is contained within the path (echo $PATH).

Marki

Posted 2014-01-26T02:37:56.403

Reputation: 572