Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Catfish Jones

macrumors member
Original poster
Sep 22, 2005
32
0
You'd think this was all pretty basic. It probably is. :(

I'm trying to open/edit '/usr/local/php5/lib/php.ini' with TextWrangler through Terminal. The TextWrangler part isn't an absolute requirement. The directory exists and I'm assuming the file does as well. (No 404-esq errors during my fumblings and it was a standard installation of PHP5)

Also, is there any way to browse through the above directory using the Finder's GUI? That would be nice...
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,776
15
Grand Rapids, MI, USA
You'll like this.

The command you're looking for is called "open." :D

If you are in a directory,

open .

will open the directory in Finder. Specifying a folder either relatively or directly will also open it in Finder.

open ~/documents

Open will open any file in the default reader if the file is passed to it.

open spreadsheet.xls

Will launch Excel and open spreadsheet.xls, for instance. The only wrinkle for you is that TextWrangler may not be the default for opening .ini files. You can do this:

open -a /applications/textwrangler.app file.ini

Where you can replace the textwrangler part with the actual location and name of the app.

Does that help? :)
 

devman

macrumors 65816
Apr 19, 2004
1,242
8
AU
Catfish Jones said:
You'd think this was all pretty basic. It probably is. :(

I'm trying to open/edit '/usr/local/php5/lib/php.ini' with TextWrangler through Terminal. The TextWrangler part isn't an absolute requirement. The directory exists and I'm assuming the file does as well. (No 404-esq errors during my fumblings and it was a standard installation of PHP5)

Also, is there any way to browse through the above directory using the Finder's GUI? That would be nice...

I'm no terminal expert but "open filename" will open a file with whatever app it is associated with.

For the Finder use the menu item Go->Go to folder (SHIFT-CMD-G).
 

Catfish Jones

macrumors member
Original poster
Sep 22, 2005
32
0
Thanks mkrishnan and devman. Works beautifully. I even figured out my global issue. I kept searching for things like "open file mac os x terminal" and wasn't getting any results. Replacing "mac os x terminal" with "unix" in my searches sure boosted the result count. :rolleyes:

Hopefully that means no more stupid questions from me. :D

Thanks again guys.
 

mduser63

macrumors 68040
Nov 9, 2004
3,042
31
Salt Lake City, UT
The open command will work, but I thought you might be interested to know that TextWrangler includes a command-line tool for opening files. You can install it by opening TextWrangler Preferences, going to the "Tools" section and then clicking "Install Command Line Tools". After you do that, you can type "edit name_of_file.txt" from Terminal to open any file in TextWrangler. I've actually never tried using that feature, but it is an advertised feature of TW.
 

bobot

macrumors newbie
Nov 17, 2008
1
0
You'll like this.

The command you're looking for is called "open." :D

If you are in a directory,

open .
:eek:

If you're building nonlinear bayesian models, assembling vast databases or working towards an AI singularity, the unix/Linux crowd has lots to offer. The detail people go into is incredible, and I've learned a fair bit.

I've been using linux it almost exclusively for about a year and a half and this is literally the first time I have found a straightforward, relevant answer to the question "How the hell do I open a file?"

Don't get me wrong, I have listened to dozens of detailed explanations, which laboriously explain examples of every aspect of the commands, and cheerfully say "Now just open this file..."

Unbelievable. Quite frankly, if it wasn't for the excellent and active support communities, I don't think it would be nearly as popular.

Thank you SO much. I really appreciate it.
 

08380728

Cancelled
Aug 20, 2007
422
165
What is the solution to using the 'open' command on a filename such as '(te) tvseries - Season 2.torrent' ?? terminal reports file doesn't exist
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.