LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-03-2004, 02:34 PM   #1
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Rep: Reputation: 16
wo to set up executable so i can run it without typing whole path?


Hi,

I wonder on how i can make it so that I can type just "programname" from anywhere and it runs, rather than "/whole/path/programname"?

Kinda like vim filename works from anywhere...

thank you
 
Old 07-03-2004, 02:41 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
If the script is in the current directory:
./script

If it is not then put it in one of the directories that is in your $PATH:
echo $PATH

To add a new directory to your path:
export PATH="/path/to/new/path:$PATH"
 
Old 07-03-2004, 04:40 PM   #3
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Another option, say if the application has to remain in its original directory, is to make a symlink in a directory which is already in your path, or you could make an alias to the program.
 
  


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
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 12:24 AM
Cannot not run executable jar file after set content type for download antony_csf Programming 1 12-08-2004 12:22 AM
Path of the executable brainstormingin Programming 4 03-25-2004 09:24 PM
Executable, but not in path. Sledge Red Hat 0 12-03-2003 08:48 PM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 02:52 AM


All times are GMT -5. The time now is 06:21 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration