Command to start Sublime Text on Ubuntu

There is a quick method to open Sublime Text from Terminal on Mac OS X.

This is how to run Sublime Text on ubuntu terminal.

Create command file:

sudo vim /usr/local/bin/subl

Copy & Paste below code, and change to your Sublime Text path

$HOME/Apps/Sublime\ Text\ 2/sublime_text $1 &

Give execute permission

sudo chmod +x /usr/local/bin/subl

Then you can do like this

subl .


subl filename

Open Sublime Text 2 from Terminal Like TextMate

Updated@2012-06-26 23:00 +1000:

It looks like sublime text 2 has official doc to support os x command line, I made it into /usr/local/bin/

ln -s "/Applications/Sublime Text" /usr/local/bin/

I used to run below command from terminal to open current projects in TextMate.

mate .

Now I am swiching to Sublime Text 2. Which is missing this. What I need to do just add below code into ~/.bash_profile

alias sub='open -a "/Applications/Sublime Text"'

Then I can open projects the same you would have in TextMate in Sublime Text but with the following command

sub .

That means you also can open any app from terminal, like when I want to edit markdown post in jekyll, or edit README file in my project from terminal by Byword:

alias bw='open -a "/Applications/"'

Terminal Prompt for Mac OS X

I have re-installed my Macbook Pro with Mac OS X Lion.

And I did another research to enhance terminal prompt to make it get better looking.

What I need:

  • seperate each command part
  • show git branch
  • colors

You can get it from here

List no merged branches on git

We are using git-flow as git branching model to do development.

However, there are more and more feautre branches were generated, and we need to make a list quickly for all branches to see which branch is still under development and not merged into master branch sometimes.

Then this command will give a huge help.

git branch --no-merged master

And if add -a you can get all include remote branches.