Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show and access .bash_profile file from finder [closed]

Tags:

bash

unix

macos

I was playing around with setting additional paths within .bash_profile. To see what would happen I did: export PATH="/Users/neil/blah" and purposefully did not include $PATH on the end of it. Now of course my path is broken, so when I go into terminal it won't let me type anything.

Basically what I need to do is find a way to access my .bash_profile file to fix it in (finder preferably), all without using terminal.

Any suggestion on how I can find and modify this hidden file without using terminal?

Thanks in advance!

like image 974
Neil Avatar asked May 21 '15 15:05

Neil


2 Answers

PATH is only needed for lookups when you don't provide an absolute path. While

vi .bash_profile

might not work, because the shell doesn't know where vi is, the following would:

/usr/bin/vi .bash_profile

(Assuming the vi actually is in /usr/bin/).

like image 63
chepner Avatar answered Nov 03 '22 00:11

chepner


Manually type the path ~/.bash_profile into any text editor, or tell finder to show hidden files and navigate there. Also if terminal is having problems you should still be able to ctrl-c out of the messages and cd around the use vim to fix it.

like image 45
errata Avatar answered Nov 03 '22 00:11

errata