Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I can navigate my files quite fast through terminal. Faster than double clicking... open... look, double click... etc.

How do I open a directory in the Ubuntu GUI? For example:

cd projects
{some cmd} client_project

Then voila, it opens in the Ubuntu GUI as if i navigated manually?

Also, how can I open a URL in my default browser via terminal. It'd be awesome to go: F12

open http://google.com

And Chrome opens it up.

share|improve this question

4 Answers 4

up vote 15 down vote accepted

To Open Directory:

  • To open a Folder from terminal type the following,
    nautilus /path/to/that/folder
    or
    xdg-open /path/to/the/folder
    i.e
    nautilus /home/karthick/Music
    xdg-open /home/karthick/Music
  • Simply typing nautilus will take you file browser,
    nautilus

To Open URL:

Note:

  • Linux is case sensitive,so type the file name correctly.
  • You can also add an alias to short the command,for example if you need openurl instead of x-www-browser you should edit the .bashrc file
    sudo gedit ~/.bashrc
  • In the bottom of the file add the following lines,
    alias openurl="x-www-browser" alt text
  • Save and close the file.
  • Now you can open URL'S by typing,
    openurl http://google.com
share|improve this answer
3  
xdg-open works for directrories and other files, too –  Florian Diesch Dec 12 '10 at 13:33
    
@FlorianDiesch forgot to include that,thanks for remembering :) –  karthick87 Dec 12 '10 at 13:37
1  
It's worth pointing out more gernerally that xdg-open should have the same result as clicking on any file in a folder or on your desktop. It should open your file/folder/url with the default application to handle that file type. I have it aliased as go in my ~/.bashrc –  andrewsomething Dec 12 '10 at 18:59
    
Awesome, thanks a lot. I installed Komodo and it set up komodo somefile.html to open files but i didn't see it in the bashrc file. Where else could it be and could I change it to edit somefile.html but opens in Komodo as if i typed komodo? –  Oscar Godson Dec 12 '10 at 21:39
    
Well, there's already a /usr/bin/edit, so I'd choose something else, but anyways... In ~/.bashrc add a line that says alias edit='komodo' –  andrewsomething Dec 12 '10 at 22:43

Instead of typing all the quotes etc. one could use:

nautilus .

Works with directories containing spaces in their names.

share|improve this answer

Nope, the above answers are OK, but this is what I think you are looking for:

nautilus `pwd`

xdg-open `pwd`

I was just experimenting today, and it worked. Isn't it fabulous?

share|improve this answer
    
I would suggest using "$(pwd)" because: 1. backticks are considered old-style and 2. directory name may contain spaces. –  Andrea Corbellini Aug 22 '13 at 11:54
    
@AndreaCorbellini Yup, I agree. Will modify answer later. –  Pratik Bothra Aug 22 '13 at 18:01

You can just call the aplication. Both Nautilus and Chrome accept path (url) as parameter.

nautilus /directory/subdirectory/subsubdirectory

or

cd /directory/subdirectory/subsubdirectory and then nautilus . (the dot is important -- it says to Nautilus to open the current directory)

google-chrome www.google.com

or

x-www-browser www.google.com -- this command calls the browser set as default (so if your default browser is Chrome, it will open Chrome)

share|improve this answer
    
how would one add a shorter command that does x-www-browser? i.e. openurl www.google.com? –  Oscar Godson Dec 12 '10 at 10:32
    
You can create an alias. en.wikipedia.org/wiki/Alias_%28command%29 Just add alias open="x-www-browser" to ~/.bashrc file –  Vojtech Trefny Dec 12 '10 at 10:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.