Showing posts with label executable file. Show all posts
Showing posts with label executable file. Show all posts

Friday, January 2, 2015

LINUX Create Executable Binary File

I'm newbie trying to learn about linux, Centos 6.5. Today I learned how to change from #./yourprogram in certain directory to #yourprogram. I want to share it here.

Condition:
I've just downloaded Eclipse for example. In tar.gz.
When I extracted the files in certain folder, I can run the program by calling #./eclipse.

Goals:
What I do want is to run a simple command $eclipse, then I can have my program running.

Answer:
Consider this as your program directory.
/usr/eclipse
it can be any directory.

This is the way.
#touch /usr/bin/eclipse
#chmod 755 /usr/bin/eclipse
#vi /usr/bin/eclipse

then put this inside.

export ECLIPSE_HOME="/usr/eclipse"
$ECLIPSE_HOME/eclipse $*
Finished!