Gnome equivalent of Windows ‘start’ command
Friday, August 7th, 2009
Being the command-line type of guy that I am, in the Windows world, I will often find myself at a CMD prompt wanting to start up Windows Explorer in the current directory, run a file with its associated program, or start a browser and send it to a URL.
In Windows, one uses the ‘start’ command to do this. It is essentially like typing something into the ‘Run’ dialog from the Start menu. If you specify a URL, it starts up your browser at that page. If you specify a path to a local directory or a UNC to a share, it will start up Windows Explorer with that target. If you specify a file whose extension is associated with a program, it will start up in that program.
Now that I have been using Ubuntu as my main OS for a couple of years, I have found that you can do the same thing in Gnome with the command ‘gnome-open’. I even went so far as to alias it to ‘go’ by putting the following line in my ~/.bashrc file:
alias go='gnome-open'
Then it is a simple matter of using ‘go’ to do all sorts of things:
Open a pdf in Document Viewer:
# go document.pdf
Open a file browser in the current directory:
# go .
Open a URL:
# go http://www.google.com
Compose an email:
# go mailto:someone@example.com
Search for all the people who have blogged about this very topic:
# go 'http://www.google.ca/search?q=gnome-open'
Being the command-line type of guy that I am, in the Windows world, I will often find myself at a CMD prompt wanting to start up Windows Explorer in the current directory, run a file with its associated program, or start a browser and send it to a URL.
In Windows, one uses the ‘start’ command to do this. It is essentially like typing something into the ‘Run’ dialog from the Start menu. If you specify a URL, it starts up your browser at that page. If you specify a path to a local directory or a UNC to a share, it will start up Windows Explorer with that target. If you specify a file whose extension is associated with a program, it will start up in that program.
Now that I have been using Ubuntu as my main OS for a couple of years, I have found that you can do the same thing in Gnome with the command ‘gnome-open’. I even went so far as to alias it to ‘go’ by putting the following line in my ~/.bashrc file:
alias go='gnome-open'
Then it is a simple matter of using ‘go’ to do all sorts of things:
Open a pdf in Document Viewer:
# go document.pdf
Open a file browser in the current directory:
# go .
Open a URL:
# go http://www.google.com
Compose an email:
# go mailto:someone@example.com
Search for all the people who have blogged about this very topic:
# go 'http://www.google.ca/search?q=gnome-open'