views:

146

answers:

4

Often times, I find myself navigating very deep into a directory and wanting to open the graphical window (nautilus) for various reasons. So the question is simple:

After doing,

cd sampledirectory  
cd sampledirectory2 

How can I open this location in a GUI?

+6  A: 

I assume Gnome with Nautilus:

nautilus .

To open in the current directory.

Replace nautilus with whichever File Manager you use (Dolphin, etc).

Nick Presta
Cool! I kept trying nautilus and it opened the window in my home directory. Help didn't provide much either.. Thanks a lot!
Legend
@Nick I will check this. mostly i use ALT + F2 command to go to specific directory.
Adeel
@Adeel: Yes. That works but I wanted it to instantly open the current location in a GUI file manager...
Legend
+3  A: 
nautilus --no-desktop . &
Ignacio Vazquez-Abrams
Actually typing `nautilus .` opens the window in the background without keeping the terminal busy... Thanks anyways..
Legend
Not in all situations. Such as if you don't normally run nautilus.
Ignacio Vazquez-Abrams
Oh... I didn't know that.. Thanks for the clarification...
Legend
+1  A: 

nautilus .


I've done this a zillion times.

Here is how I do it on every system:

Mac:

#!/bin/sh
open /System/Library/CoreServices/Finder.app ${1:-.}

Linux / BSD, if Gnome:

#!/bin/sh
nautilus ${1:-.}

Windows ... Cygwin ...

#!/bin/sh
[ $# -eq 1 ] && exec explorer "$(cygpath -w "$1")"
DigitalRoss
+2  A: 

The most portable way should be using freedesktop's xdg-utils xdg-open. For example

   $ xdg-open .

this has the advantage of choosing from your desktop preferences the tool to open different file types, like for example

   $ xdg-open ~/Documents/mypresentation.odp

or

   $ xdg-open ~/Pictures/mypic.png
dtmilano
This is very useful too... Thanks!
Legend