Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to know if there is a way to open a file or a folder from terminal?

When I wrote a URL LINK in terminal, it's allows me to open that link on my default browser. So I'd like to do the same with my files and folders.

Eg. When I write "pwd" the path allows me to click and open on Nautilus

It's the inverse of what "nautilus-open-terminal" does.

share|improve this question

migrated from Jun 19 '11 at 20:32

This question came from our site for professional and enthusiast programmers.

Which terminal? – Ignacio Vazquez-Abrams Jun 19 '11 at 18:40
I'm using gnome-terminal. – Victor Hugo Souza Jun 19 '11 at 18:49

In the current directory:

nautilus .

Some other directory:

nautilus /tmp
nautilus "$HOME"


Edit As I understand you prefer something to click on, let's start with making it a URI/URL in the first place (sic): e.g.

echo "file://$PWD"

Now you can click the url as ever and nautilus will open there. It isn't foolproof with spaces, special characters etc. although there is a chance that your terminal will magically DoTheRightThing TM. Other than 'using' URL's like this, I don't think there is a way.

share|improve this answer
Which part of this involves clicking on the path? – Ignacio Vazquez-Abrams Jun 19 '11 at 18:40
Mmmm. So unexpected I couldn't imagine the OP wanted that. Added my idea for that. – sehe Jun 19 '11 at 18:47
But is there any way to add the "file://" URI Scheme to something, so the bash or the terminal can add the files and folders automatically? Then when I use PWD and click on the path, nautilus will open? – Victor Hugo Souza Jun 19 '11 at 18:55
Like I said, I don't think so – sehe Jun 19 '11 at 19:06

You must log in to answer this question.