How to edit PATH variable outside of terminal

Joined
Apr 20, 2011
Messages
2
Reaction score
0
Points
1
I'm wondering if there's any possible way to edit my PATH variable outside of terminal. I sorta messed around with /usr/bin, and now I can't copy or move the backups I made of it back in to replace them, since it can't run the correct commands.
 
Joined
Dec 11, 2010
Messages
1,808
Reaction score
40
Points
48
Location
Chicago
Your Mac's Specs
late 2012 mini w/SSD
I think you need to reinstall OS X - who knows what else you've messed up?

You can edit ~/.profile to set up the PATH variable.
 
Joined
Aug 2, 2005
Messages
1,229
Reaction score
75
Points
48
Your Mac's Specs
2.6GHz Core i7 15" MacBook Pro - 8GB DDR3 SDRAM - 750GB 7200 RPM HDD - GeForce 650M GT 1GB VRAM
You should still be able to move the backups you made back in using Finder, even if you've messed up your command line tools. Remember that you can use Go -> Go To Folder... in Finder to go to any folder on your system, even if it's hidden. All that said, if you're going to mess around with putting your own command line commands in OS X, in the future, you should just make some other directory for them and add it to your PATH. I normally just laugh at people who've messed up in the way you claim to have.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
You may not need to reinstall anything - it's very possible we can fix this.

You can still run commands - you'll just need to use the full path to the binaries. For instance, instead of running "cp", run "/bin/cp". You can find binaries by executing "/usr/bin/whereis <name of bin>". For instance, you can execute "/usr/bin/whereis mv" and it will print back the location of mv.

Now that you have the full path of apps, execute the commands you need. And as a tip for the future (and something you're probably well aware of now) - don't mess around with parts of the filesystem that you shouldn't be modifying.
 
OP
O
Joined
Apr 20, 2011
Messages
2
Reaction score
0
Points
1
Thanks all :). Sorta learned my lesson there. Also I found that under /etc you can modify paths.d as a text file. Problem was, I wasn't logged in as root, so I couldn't modify them, and once I shut down the computer, it wouldn't reboot, so I had to reinstall it. And that's why you don't mess with /bin files....
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top