Ask Dave Taylor
  • Facebook
  • Instagram
  • Linkedin
  • Pinterest
  • Twitter
  • YouTube
  • Home
  • YouTube Videos
  • Top Categories
  • Subscribe via Email
  • Ask A Question
  • Meet Dave
  • Home
  • Linux Help
  • How do I tweak my PATH?

How do I tweak my PATH?

April 1, 2004 / Dave Taylor / Linux Help / No Comments

A reader writes:

“I’ve got a few of your books and today picked up Wicked Cool Shell Scripts, which I’m very much looking forward to working with.

“Totally greenhorn question, though: I want to keep the scripts in ~/bin and on page 12 you have an italic note saying to edit our PATH variable, but I’m not sure how, and don’t see any instructions anywhere else as to how to do this. I would be perfectly happy to have ~/scripts as you suggest but have not been able to create either. Your other book
Learning Unix for Mac OS X doesn’t appear to show how to do this with BASH. Many thanks in advance.”

The standard way to alter your PATH is to add a line to your ~/.bash_login, ~/.profile or ~/.login file (depending on which shell you’re using). Bash will read either of the first two filenames, but let’s use ~/.bash_login for consistency sake.

Open up that file (or create one if you don’t have it yet) by using vi, pico, emacs, jove, or whatever else is your favorite editor in Terminal.app. Then append your desired directory to the end of the existing PATH value like so:


export PATH="${PATH}:/Users/joe/bin"

Close that terminal window and open another (File -> New Shell), then type echo $PATH and you should see your specified path appended to the end. Then just make sure you have that directory (you can use mkdir ~/bin to create it if needed).

Now you can drop scripts and programs into that file to your heart’s content, and they’ll automatically be found when you type in their names to the shell.

Note that there’s a slight variation on this that can work too, and that might be more commonly used, as demonstrated by this actual entry in my own ~/.bash_login file:


PATH="${PATH}:/sw/bin:/usr/X11R6/bin:/Users/taylor/bin"; export PATH

Hope that helps clear things up!

Let’s Stay In Touch!

Never miss a single article, review or tutorial here on AskDaveTaylor, sign up for my fun weekly newsletter!
Name: 
Your email address:*
Please enter all required fields
Correct invalid entries
No spam, ever. Promise. Powered by FeedBlitz
Please choose a color:
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Recent Posts

  • Can I Remotely Disable Apple Pay on my iPhone?
  • Easy Way to Check for a System Update on KOBO Libra H2O eReader?
  • Disable Contactless Google Pay (GPay) on an Android Phone?
  • How to Have a Honda Vehicle Forget Your Phone?
  • How Do I Free Up Disk Space On My Windows PC?

On Our YouTube Channel

Monoprice Harmony Capsule 300 Outdoor Bluetooth Speaker -- UNBOXING, DEMO & REVIEW

Twinkly "DOTS" Flexible Smart LED String -- DEMO & REVIEW

Categories

  • AdSense, AdWords, and PPC Help (106)
  • Amazon, eBay, and Online Shopping Help, (161)
  • Android Help (194)
  • Apple iPad Help (144)
  • Apple Watch Help (51)
  • Articles, Tutorials, and Reviews (344)
  • Business Advice (198)
  • Chrome OS Help (21)
  • Computer & Internet Basics (756)
  • d) None of the Above (164)
  • Facebook Help (381)
  • Google, Chrome & Gmail Help (175)
  • HTML & Web Page Design (244)
  • Instagram Help (47)
  • iPhone & iOS Help (602)
  • iPod & MP3 Player Help (173)
  • Kindle & Nook Help (92)
  • LinkedIn Help (85)
  • Linux Help (162)
  • Linux Shell Script Programming (86)
  • Mac & MacOS Help (887)
  • Most Popular (16)
  • Outlook & Office 365 Help (24)
  • PayPal Help (69)
  • Pinterest Help (53)
  • Reddit Help (17)
  • SEO & Marketing (81)
  • Spam, Scams & Security (92)
  • Trade Show News & Updates (23)
  • Twitter Help (217)
  • Video Game Tips (66)
  • Web Site Traffic Tips (62)
  • Windows PC Help (909)
  • Wordpress Help (204)
  • Writing and Publishing (72)
  • YouTube Help (45)
  • YouTube Video Reviews (159)
  • Zoom, Skype & Video Chat Help (56)

Archives

Social Connections:

Ask Dave Taylor


Follow Me on Pinterest
Follow me on Twitter
Follow me on LinkedIn
Follow me on Instagram


AskDaveTaylor on Facebook



microsoft insider mvp


This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to our terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. Our lawyer says "Thanks for your cooperation."
© 2022 by Dave Taylor. "Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.
Privacy Policy - Terms and Conditions - Accessibility Policy