You are not logged in.

#1 2008-08-09 23:15:34

COMMUNISTCHINA
Member
Registered: 2008-06-16
Posts: 122
Website

Terminal Commands

Here's something I don't understand:

When I do something like pacman -S firefox, after it's installed, I can just open Firefox by typing in "firefox" into terminal.
If I install it from the web, extract the tar, etc., i have to find the folder Firefox is in, then type "firefox" to open it.

How do I (aside from using an alias) set it so I can simply type in "firefox" and it will execute it?

I use Firefox as an example, but really it could be any program.


i don't know you that well.

Offline

#2 2008-08-09 23:53:03

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: Terminal Commands

COMMUNISTCHINA wrote:

Here's something I don't understand:

When I do something like pacman -S firefox, after it's installed, I can just open Firefox by typing in "firefox" into terminal.
If I install it from the web, extract the tar, etc., i have to find the folder Firefox is in, then type "firefox" to open it.

How do I (aside from using an alias) set it so I can simply type in "firefox" and it will execute it?

I use Firefox as an example, but really it could be any program.

write a start-up script:

!#/bin/bash
cd <firefox dir>
./firefox.bin

Offline

#3 2008-08-09 23:59:12

ghostHack
Member
From: Bristol UK
Registered: 2008-02-29
Posts: 261

Re: Terminal Commands

Its probably a PATH issue, when you install firefox from the repos via pacman it is installed into /usr/bin which is in the default path, when you untar the mozilla version the directory it extracts into is most likely not in your path.  You could append this directory to your path in you .bashrc.  e.g. if the 'firefox' executable is extracted to /opt/mozilla/firefox/bin then you would set 'export PATH=$PATH:/opt/mozilla/firefox/bin' in your .bashrc or .bash_profile

Last edited by ghostHack (2008-08-09 23:59:47)

Offline

#4 2008-08-10 04:43:46

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Terminal Commands

Have a look at your bash PATH variable:

echo $PATH

The directory that you manually installed the program to isn't listed in what comes out...

You'll need to do that ghostHack said to modify your path, or make a symbolic link from the installed program to something that is in your path.

For example, if you manually installed firefox to /home/myuser/mozilla/ then you could create a sym link like this:

ln -s /home/myuser/mozilla/firefox /usr/bin/firefox

Bash would then find firefox in /usr/bin/ which would point it to /home/myuser/mozilla/firefox and execute it just by typing 'firefox' in your shell.

Offline

#5 2008-08-10 06:37:20

COMMUNISTCHINA
Member
Registered: 2008-06-16
Posts: 122
Website

Re: Terminal Commands

Cool. Thanks, guys.


i don't know you that well.

Offline

Board footer

Powered by FluxBB