开发者

How to launch sqlite Database browser from the command line on Mac OS X

I am following a tutorial for Ruby on Rails3. The author types the following which launches sqlite Database Browser and opens the specified database.

open db/development.sqlite3

What can I do to configure my system to do the same? I am on Mac OS开发者_如何学CX 10.6

Thanks in advance :)


You can install sqlite3 command line tool from MacPorts or you can download, satisfy dependencies and compile it yourself.

If you have macports installed, execute command

sudo port install sqlite3

then

sqlite3 anyfile.db

to launch command line interface on specified sqlite3 file.


On Mac OS X, the command open FILE will perform the same action as double-clicking the file in Finder. If it is not working, it's because the file type needs to be associated with the application:

  1. Select the file in Finder.
  2. Select "Get Info" from the File menu.
  3. In the "Open with:" section, pick the application you want.
  4. Optionally, click "Change All..." to use that app for all files with same extension.

Afterward, open will launch that app with that file.

If you don't want to change the type, you can also tell the open command which app to use:

open -a "App Name" FILE

Type man open to see the manual page which will explain in more detail how it works.


Download sqlite-shell-osx-x86-3071401.zip from http://www.sqlite.org/download.html Double click the zip, then double click sqlite3.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜