The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,570 other followers

Mac OS X: editing ~/.bash_profile using TextEdit

Posted by jpluimers on 2013/05/10

Finder on your Mac by default does not show hidden files, and the console has vi, which lots of people find awkward to use.

There is an easy trick to open a hidden file like ~/.bash_profile (for instance to add an alias) with a visual text editor.

Just execute this in your terminal:

  • Always with TextEdit
    open -e ~/.bash_profile
  • For the default text editor (usually TextEdit)
    open -t ~/.bash_profile
  • For a specific text editor (in this cast TextWrangler)
    open -b com.barebones.textwrangler ~/.bash_profile

The man open(1) page has more information on the parameters you can pass to open.

–jeroen

PS: You can teach Finder to Quickly show and hide hidden files | Finder, Terminal | Mac OS X Tips.

6 Responses to “Mac OS X: editing ~/.bash_profile using TextEdit”

  1. […] I do moste of the editing from the console, and used this trick to edit text files from the console. […]

  2. […] Now I have these aliases in my ~/.bash_profile: […]

  3. Ruurd Pels said

    TextEdit… Anybody that wants to edit their bash profile should be in a stage where they either should use TextMate or Sublime Text. And then it’s easy as mate .bash_profile or subl .bash_profile. That said: you migh want to have a look at brew and install nano for command line editing.

    • jpluimers said

      On the command-line, I’m used to pico or joe (because of my Linux and WordStar background).
      I’m still expanding the toolbox on my Mac.
      Will look into TextMate and Sublime Text.
      BTW: from what I have used so far, I do like TextWrangler.

      • Ruurd Pels said

        Found TextWrangler so so. Like TextMate more. Sublime is excellent too but rather expensive.

        Absolutely indispensible: Alfred, TextExpander and Hazel
        Very nice to pimp your desktop: Geektool
        Toolbox I have: MonoSnap, Bartender, Pomodori, Palua, You Control Tunes, Cobook, Day One, QuickCal, ClipMenu, Popclip, Liquid Pro, Freeman, Bulb
        Regular used apps: Things, Taskpaper, Pocket née Read Later, Notebook, MarsEdit, EasyBooks, Soulver, Rubymine, IntelliJ, Coda (VERY VERY NICE), Codekit, MultiMarkdown Composer, TextMate, Sublime Text 2, Dash, SourceTree, Kaleidoscope, Sequel Pro, Pages/Numbers/Keynote, MindNode Pro, SketchBook 6 Pro, LibreOffice

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: