Open hidden configuration files without using Terminal

10

6

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?

upbeat.linux

Posted 2011-06-28T18:04:26.127

Reputation: 103

Can you execute commands? Try running something like echo test and see if the command works. – Wuffers – 2011-06-28T19:24:13.007

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 – 2011-06-28T19:37:40.530

@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. – upbeat.linux – 2011-06-29T06:00:17.213

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 – 2011-06-29T06:32:19.533

Answers

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.

Daniel Beck

Posted 2011-06-28T18:04:26.127

Reputation: 98 421

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! – upbeat.linux – 2011-06-29T06:03:07.383

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.

James T Snell

Posted 2011-06-28T18:04:26.127

Reputation: 5 726

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! – upbeat.linux – 2011-06-29T05:56:51.910

Heh, someone down voted this answer today. How random. – James T Snell – 2012-01-04T23:47:16.273

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 – 2012-12-01T05:40:07.853

1

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

http://secrets.blacktree.com/

Somantra

Posted 2011-06-28T18:04:26.127

Reputation: 320

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! – upbeat.linux – 2011-06-29T05:55:53.550

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.

upbeat.linux

Posted 2011-06-28T18:04:26.127

Reputation: 103

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 – 2012-12-01T05:41:26.293