5

System utilities such as ls don't need to have the full path typed before executing them. However, to execute Netbeans, I have to type /home/chris/netbeans-7.0.1/bin/netbeans. How can I make it so that I only have to type netbeans?

Casebash
  • 6,059

3 Answers3

8

An easy way is to place a link in /usr/local/bin:

sudo ln -s -T /home/chris/netbeans-7.0.1/bin/netbeans /usr/local/bin/netbeans

after that you can execute netbeans with:

netbeans &
Michael K
  • 14,338
4

You can add an alias

Open Terminal Ctrl+Alt+T

nano ~/.bashrc

write this at the bottom of the file:

alias netbeans='/home/chris/netbeans-7.0.1/bin/netbeans'

Ctrl + x

Y

Enter

The netbeans word is the command you will use to start the program, you can change it to whatever you need. Inside the quotes is the command you want to run when netbeans alias is called.

In order this command to be active you have to re-open the Terminal, or type

. ~/.bashrc
-1
  1. go to the program directory.
  2. open the terminal using ctrl+alt+T.
  3. Drag and drop the program file to the terminal windows.
  4. Hit enter on the terminal windows.