Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Jun 19 '12 at 4:52

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

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.

share|improve this answer
Notice that mv does not work without a proper PATH. export is the answer. – J. C. Leitão Aug 28 '14 at 14:46

Just use explicit paths until you have fixed your PATH variable:

$ /usr/bin/nano ~/.profile
share|improve this answer

In the Terminal type:

defaults write AppleShowAllFiles TRUE

killall Finder

By the way, you should be able to edit the file in your terminale by running:

/usr/bin/nano ~/.profile


if you can't use the terminal, download this:

It's preference pane that lets you change some advanced options, among them there is also the "Show hidden files" in Finder.


share|improve this answer
I can't use the terminal. – Ramy Al Zuhouri Apr 25 '12 at 15:04
Why can't you use Terminal ? It should still work OK even if PATH is not set. – Paul R Apr 25 '12 at 15:10
They're right. What's up with your terminal? What happens if you open it e.g. with Spotlight? – lorenzo.marcon Apr 25 '12 at 15:40
The purpose of editing the .profile file was that the PATH was messed up.So I could use the terminal, but not the bash commands.I exported the PATH manually like shown by the accepted answer. – Ramy Al Zuhouri Apr 26 '12 at 16:56
I'm glad for you if you solved your problem, but still can't understand the -1 on my answer. You asked how to see hidden files on finder, and here I provide two ways to accomplish this.. – lorenzo.marcon Apr 26 '12 at 22:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .