LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-25-2004, 09:37 AM   #1
simsjr
Member
 
Registered: Apr 2004
Location: I'm everywhere, Focker!
Distribution: Slackware
Posts: 53

Rep: Reputation: 16
Making programs accessible from command line


Hey All,

I'm a Slackware noob who's trying to figure out how to install new programs so that all I have to do is type in their executables to launch them (like from xterm).

For example, I downloaded and unzipped Mozilla Firefox to a directory within /opt. It runs fine when I go to /opt/firefox and type "firefox", but not from any other location.

Know what I mean?
 
Old 04-25-2004, 10:06 AM   #2
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
yeah, well, if your executable is in some dir and can only be started by "going" there first, then the executable isn't in your path so one solution would be to create a symlink to your path pointing to the executable, like this:

let's say you have a program called run.sh in /home/name/run/. now you can only start it by either cd'ing to /home/name/run/ and running it or by typing /home/name/run/run.sh - the trick to make it runnable "from any place" is this: let's make a symlink to, say, /usr/bin with a command like this:

ln -s /home/name/run/run.sh /usr/bin/run

after this you would just type "run" (without quotes) no matter "where" you are, to run the program from /home/name/run/. simple as that so just do a "ln -s /the/path/to/executable /usr/bin/appname" without quotes. got it?
 
Old 04-25-2004, 10:55 AM   #3
simsjr
Member
 
Registered: Apr 2004
Location: I'm everywhere, Focker!
Distribution: Slackware
Posts: 53

Original Poster
Rep: Reputation: 16
Talking

Hey, rock on!

You made my day.

One more thing - does this also mean that all programs installed to /usr/bin are runnable from anyplace?

Last edited by simsjr; 04-25-2004 at 11:00 AM.
 
Old 04-25-2004, 12:29 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86; Gentoo PPC; Gentoo Sparc64; FreeBSD; OS X; Solaris
Posts: 3,731
Blog Entries: 4

Rep: Reputation: 65
As long as it is in your path:

echo $PATH

To change do a:
export PATH=$PATH:/more/directories:/to/add/here:/seperated/by/colon
 
Old 04-27-2004, 07:03 AM   #5
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
just as bulliver said
 
Old 04-27-2004, 08:56 AM   #6
simsjr
Member
 
Registered: Apr 2004
Location: I'm everywhere, Focker!
Distribution: Slackware
Posts: 53

Original Poster
Rep: Reputation: 16
swell. Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Programs from command line sumguy231 Linux - Software 4 12-17-2004 03:10 PM
launching programs from command line in FS dertien Linux - Software 1 11-26-2004 09:27 AM
making aliases via command line MACSRULE *BSD 1 04-07-2004 03:14 PM
Launching Programs From the Command Line Chryzmo Linux - Software 5 03-03-2004 08:00 PM
Running programs from Command Line SirLostalot Linux - Newbie 1 11-11-2002 09:24 PM


All times are GMT -5. The time now is 01:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration