Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com 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

1 Answer 1

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.

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

Your Answer

 
discard

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