LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to register a program for command line?? (https://www.linuxquestions.org/questions/linux-software-2/how-to-register-a-program-for-command-line-254068/)

wepakis 11-12-2004 01:11 PM

How to register a program for command line??
 
Hi guys,
My question might be lame but please bare with me as I am a linux newbie. I insatlled RedHat Fedora Core 2 as a dual-boot. So far, I've been able to fix overall OS problems.

My problem is that I downloaded and installed FireFox. I have made a launcher on Desktop. But I want to be able to launch it from the terminal. For example, right now, I can type "Mozilla" in terminal and it will launch Mozilla browser. Is there any way, I can type "Firefox" in terminal and it will launch the browser.

I don't even know what it is called. Right now I'm calling it "registering an application" I'd appreciate it if someone can tell me the proper term for this .


Thanks In advance.

david_ross 11-12-2004 01:25 PM

Just put the application or a a symlink to it in one of the directories in your PATH:
echo $PATH

zhangmaike 11-12-2004 03:50 PM

The program file itself is named "firefox". If you don't know where that file is, do "updatedb" (as root) followed by "locate firefox".

borrrden 11-12-2004 07:08 PM

Or better yet, here is a simpler option.

Put a soft link (ln -s) to firefox in /usr/bin or /usr/local/bin.

Again, run updatedb as root and slocate (yes, slocate is correct it's a faster version of locate) firefox and that will show you where it is.

So if firefox is in your home directory the command will look like this

go to /usr/bin or /usr/local/bin and type "ln -s /home/borrrden/firefox-1.0/firefox" (without the quotes)

wepakis 11-12-2004 10:15 PM

Quote:

Originally posted by borrrden
Or better yet, here is a simpler option.

Put a soft link (ln -s) to firefox in /usr/bin or /usr/local/bin.

Again, run updatedb as root and slocate (yes, slocate is correct it's a faster version of locate) firefox and that will show you where it is.

So if firefox is in your home directory the command will look like this

go to /usr/bin or /usr/local/bin and type "ln -s /home/borrrden/firefox-1.0/firefox" (without the quotes)

Excellent work guys. Thanks so much. I used Symbolic link like borrrden said. But just out of curiousity, how do I do it using the $path. All I know is that I have to append to the path file. But I don't know how????

borrrden 11-13-2004 12:11 AM

from your home directory, open up the following with a text editor (vim, emacs, etc) ".bash_profile" (no quotes) and in it there will be a line that says $PATH=blah blah blah - just add on whatever you want to the end of that line in the same fashion (put a colon, then a directory, then a colon, then a directory, etc)

simple eh? :)

IBall 11-13-2004 12:18 AM

In ~/.bash_profile, add the lines:
Code:

PATH=/path/to/new/directory:$PATH

export PATH

Not that there must be no spaces around the = sign.

now run the command "source .bash_profile", and the new directory will be added to your path.

It is a good idea to use the symbolic link when you want to add only one executable to your path - eg firefox, but if there is a directory with lots of executables then use the path option (Eg the java execuatbles - java, javac, javaw ...) This will avoid cluttering your path up too much.

I have a directory /home/iball/bin, which is where I put shell scripts and symbolic links to programs that I want only me to have access to. Obviously, I added this directory to my path as shown above.

I hope this helps
--Ian

blazted 11-13-2004 12:25 AM

I had just installed Firefox and could not get it to run. But creting the sym link and allowed me to run it from command line.

My question is how do I get programs to run from the GUI interface. I ahve installed several programs that wer RPMs. They all installed correctlly but I have no idea on how to use them now. One program which I really want to use is Webmin which I have installed but I cannot bring up the Interface. Other programs I would like to know how to run them once they have been installed.

Thanks

IBall 11-13-2004 02:07 AM

Most programs that you install will place and executable in /usr/bin. Therefore, you should be able to run the program simply by typing the name of the program at the command line.

If you want to create a launcher on the desktop, simply right click on the desktop and select "New Launcher" The path of the executable should be just the name of the executable as you type it at the command line. Eg, if you run firefox by typing "firefox" at the command line, then the executable is "firefox"

After installing programs, you can find them by running, as root:
"updatedb" and then "locate nameOfProgram"

I hope this helps
--Ian


All times are GMT -5. The time now is 09:12 AM.