QUESTION :
I have edited the .profile file and I messed up something so that the PATH has changed and I can’t use commands such as nano, sudo, etc…
The problem would be easy to solve because I know how to edit this file again to put the corrent path.But I can’t use “sudo nano .profile” command because the PATH is messed up, and I can’t see hidden files using finder.So how do I see hidden files with finder, why can’t I see them? How to solve this ridicolous problem?
ANSWER :
You might be able to simply move (mv) the bad .profile aside, so that you get the default path. Then once you have repaired the bad .profile move it back.
You can also manually override the path you get from your .profile, but the exact syntax for doing that depends on which shell you use. For bash, for example, you would do:
$ export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Hope this helps.
Just use explicit paths until you have fixed your PATH
variable:
$ /usr/bin/nano ~/.profile
In the Terminal type:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
By the way, you should be able to edit the file in your terminale by running:
/usr/bin/nano ~/.profile
UPDATE:
if you can’t use the terminal, download this: http://blacktree-secrets.googlecode.com/files/Secrets_1.0.6.zip
It’s preference pane that lets you change some advanced options, among them there is also the “Show hidden files” in Finder.
(Source: http://secrets.blacktree.com/)