10

I made some changes to my .profile which corrupted the Terminal app. I can launch terminal but I no longer get a prompt. I can't show hidden files in order to delete the .profile or .bashrc files.

How do I go about showing hidden files without using the terminal?

4
  • Can you execute commands? Try running something like echo test and see if the command works.
    – Wuffers
    Jun 28, 2011 at 19:24
  • I edited your question's title, as it didn't match the actual question at the end of your post. You can revert if you disagree.
    – Daniel Beck
    Jun 28, 2011 at 19:37
  • @Mark - I wasn't able to execute commands at all. I even wrote a script to do this: defaults write com.apple.finder AppleShowAllFiles TRUE (with #!/bin/sh) but it wouldn't execute for some reason. @Daniel sweet, thanks. Jun 29, 2011 at 6:00
  • You need to mark these files executable (chmod +x) first. If you want Terminal to open them, give them a .tool extension. // Consider accepting an answer, since your problem seems to be solved.
    – Daniel Beck
    Jun 29, 2011 at 6:32

4 Answers 4

13

Press Cmd-Shift-. in an Open File dialog. This'll show hidden files and folders. Open your broken files, and edit them e.g. in TextEdit or the plain text editor of your choice.

In the same file dialog, you can press Cmd-Shift-G to go to a specific folder, which is useful for all those hidden Unix folders like /etc.

1
  • Sweet: one of my initial annoyances was being unable to simply and intuitively expose the Unix system files. A bit of perseverance, research, and of course superuser and everything is golden. This experience will be more enjoyable. I'm so used to transferring my key shortcuts and .bash* files from Linux box to Linux box. Thanks again! Jun 29, 2011 at 6:03
1

I'd create another user account, then login as that account, and get admin privileges via "sudo" and use that to modify your hidden files in question.

3
  • This was another option that worked for me. I tested a few of the responses and they've I've been able to recreate and solve my issue with each. Thanks White Phoenix! Jun 29, 2011 at 5:56
  • Heh, someone down voted this answer today. How random. Jan 4, 2012 at 23:47
  • It's not the best answer, but in the future when Apple decides to make it so Cmd+Shift+- doesn't unhide files anymore, this will still be a viable alternative, which makes it helpful and upvote-worthy. A previous answer on a forum said to use Cmd+Shift+B. Heh...
    – jmort253
    Dec 1, 2012 at 5:40
1

You can use secrets.prefpane to show hidden files in Finder and a lot more.

http://secrets.blacktree.com/

1
  • Thanks Somantra. I'll have to check this out. I haven't used a Mac in close to 10 years and was a bit frustrated that it wasn't out of the box hack friendly as my Linux boxes. This is an extremely helpful site! Jun 29, 2011 at 5:55
0

All the responses are great ways of solving the same issue. I replicated my issue and tested each.

BTW, my resolution was to change the default terminal shell to /bin/sh. Then in TextWrangler overwrote .bash_profile and .profile with a blank file. Logged out and then back in.

Thanks everyone.

1
  • You should indicate how to change the shell in your answer. I actually tried to do that before finding Ctrl+Shift+- but couldn't find the setting....
    – jmort253
    Dec 1, 2012 at 5:41

You must log in to answer this question.

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