Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 01-24-2012, 09:33 AM   #1
Registered: Mar 2007
Posts: 234

Rep: Reputation: 15
Bash and path issue

Attempted running of "", having "#!/usr/bin/env python" as first line, by commanding "filename" from inside a subfolder of /usr/local failed with error

bash: command not found.

I had to command either "python" or "./" in order that the python program executes.

Question: how to fix "bash" in order that the directory from where the command was issued is on my path?

thanks, chiendarret
Old 01-24-2012, 09:51 AM   #2
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,261

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Create this file in folder where by standard system searches for execute, so: "/usr/local/bin" or "$HOME/bin" if this is added to your PATH. Eventually add this directory to PATH environment variable. For example
export PATH=$PATH:/additional/path
But the first method is preferred.
Old 01-24-2012, 10:31 AM   #3
David the H.
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,837

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
Your shell will only execute commands that have a clear absolute or relative path prefixing them, or are in a directory defined by your $PATH variable.

Permanent modifications of PATH are done in your shell start-up scripts. See the INVOCATION section of the bash man page for a description of which files it loads when starting on your system.
Old 01-25-2012, 02:13 AM   #4
Registered: Mar 2007
Posts: 234

Original Poster
Rep: Reputation: 15


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
[SOLVED] Command path is in PATH but bash does not find the command. stf92 Linux - Newbie 17 03-23-2012 05:19 AM
PATH for Bash Gecopa Linux - General 7 06-23-2009 12:21 PM
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 06:48 PM
search path ($PATH) weird issue bricedebrignaisplage Linux - General 3 04-25-2007 05:41 AM
Path issue in Bash gd2shoe Linux - Software 2 08-28-2005 11:18 PM > Forums > Linux Forums > Linux - Software

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

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