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.

link|improve this question
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
feedback

migrated from stackoverflow.com Jun 19 '11 at 20:32

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

1 Answer

In the current directory:

nautilus .

Some other directory:

nautilus /tmp
nautilus "$HOME"

etc.

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.

link|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
feedback

Your Answer

 
or
required, but never shown