As a one-time thing,
open -a /Applications/TextWrangler.app myfile.txt
open -b com.barebones.textwrangler myfile.txt # same thing by ID
You can also create an alias for opening TextWrangler, that you would put on the .bash_profile file, which is an hidden file by default that is usually in your home directory.
This is the command that you could insert:
# Type 'tw' on the terminal to open TextWrangler
alias tw='open -a /Applications/TextWrangler.app'
To make TextWrangler the default:
- "Get Info" on a text file in the Finder.
- Change the "Open with:" program to TextWrangler, in the fifth information pane.
- Click the "Change All..." button at the bottom of the pane.
open file.txt. – Mar 04 '11 at 20:42openconsults the LaunchServices DB. Soopen -a TextWrangler file.txtis enough. – Asmus Mar 05 '11 at 10:27