Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 05-21-2009, 07:48 AM   #1
Registered: Nov 2006
Distribution: xubuntu
Posts: 464

Rep: Reputation: 37
Can not find program in terminal

Hi there,

Does anybody know how can I make an executable to run from terminal? I have a program which when I type its name in the terminal I want the program to be loaded.

Thank you.
Old 05-21-2009, 08:17 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
When you run a program in a terminal in searches your $PATH value so if you want a program to run like you say you either need to put it in a location on your path, or change your path to include a new place. Don't be tempted to put your "current" directory on your path though. Bad idea.
Old 05-21-2009, 08:21 AM   #3
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You have to add the directory which contains the program to the PATH environment variable. Suppose it is under /home/manolakis/some/program, just do
export PATH=/home/manolakis/some/program:$PATH
then type the name of the executable, press enter and the trick is done. Take in mind that changes to environment variables are local to the current shell, that is if you open a new terminal you have to export the new PATH again, unless you put the export statement in a file which is sourced whenever a new shell session is open (for example in $HOME/.bashrc). The above command assumes you're using sh/bash as shell. If you use a C-shell (csh/tcsh) the syntax is
setenv PATH "/home/manolakis/some/program:$PATH"


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 program from terminal with & does nothing, program stops DittoAlex Linux - General 1 10-05-2007 01:35 AM
Where can I find a terminal program? ELMIT Puppy 2 07-05-2006 12:05 AM
How do I tell what version a program is from a terminal? rkid Linux - Software 3 10-14-2003 02:07 AM
terminal program metallica1973 Linux - General 4 02-23-2003 11:04 PM
terminal program metallica1973 Linux - Networking 1 02-23-2003 10:09 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:27 PM.

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