Wednesday, February 15, 2012

Linux: Launching a program from Terminal

In linux there're couple different methods to install a program. The most often used and easy is apt-get because it does all the work. All it is a line in the terminal like:
$ sudo apt-get install terminator
and the program will install.

Programs like XAMPP where the package needs to be downloaded and extracted to a specific location. Other programs like netbeans and Komodo Edit where the package is first downloaded then extracted and then run an install script.

Sometimes I like to launch a program using the terminal such as:
$ terminator

When you install netbeans it doesn't give you this feature but I going to show you how to create it.

When netbeans is installed it creates a netbeans folder in your home directory. There you will find a netbeans executable file (~/netbeans-7.1/bin/netbeans). If you run this file it will launch the program. What we need is to put this file symbolic link (symlink) inside the directory that holds these other executable programs which is /usr/local/bin. You do this by
$ sudo ln -s ~/netbeans-7.1/bin/netbeans /usr/local/bin/netbeans

that's it!

Now netbeans may give you an error stating that you do not have permission to write in ~/.netbeans/ What is needed here is to change the permission with chmod. I gave it full access by running
$ sudo chmod -R 777 ~/.netbeans/

now you should be able to open the terminal, type netbeans and the program will launch



tags:
command line

No comments:

Post a Comment