I use the Windows command line a lot, but some things are easier with the graphical interface, such as deleting or moving a group of files that don’t have some obvious part of their name in common. I’ve know for years that you can start up Windows Explorer from the command line, and you can pass it an argument telling it which directory/folder to open in that window. The following command is a simple way to open up an explorer window for the current directory from the command line:

explorer . 

I recently learned of a Microsoft XP “Power Toy” that performs the opposite trick: when it’s loaded, a folder icon’s right-click menu in explorer includes an “Open Command Window Here” choice that brings you to a prompt with that folder as the current directory.

I was going to write “Does anyone know of an equivalent that runs on Xubuntu?” but a bit of web searching turned up xfe. When you start it from the command line with no parameters, its default behavior is to open a window with icons of the files and subdirectories in your command line’s current directory. Its tool bar includes a little terminal icon that starts up a command line window in the directory for the folder you’re viewing, so you can have it both ways with this one utility.

5 Comments

By Brian Manley on October 19, 2007 11:37 AM

Here’s a shorter equivalent:

start .

The nice thing about ‘start’ is that, when given a file or URL, will start the system default application to process the parameter:

start mailto:foobar@snee.com
start http://www.snee.com
start MyDocument.doc
etc..

Cheers,
Brian

By Danny on October 19, 2007 11:46 AM

I’ve been back on a Win32 machine a lot recently, and in the past have found Cygwin must-have. This time even more so - someone suggested the rxvt package, seems an excellent lightweight terminal.

I put xfe on a

By David Megginson on October 19, 2007 11:52 AM

If you wanted to move to regular Ubuntu (with Gnome), then you could type

nautilus .

From the shell to get a window in the current directory. To go the other way, install the (tiny) nautilus-open-terminal package, which adds a menu entry to open a shell in the current directory from a Nautilus window.

By Bob DuCharme on October 19, 2007 12:50 PM

Danny and David: Thanks!

Brian: that looks great, I’ll be using that instead of explorer.exe from now on.

For your MyDocument.doc example, though, the “start” isn’t necessary–if a document has an extension that has an app associated with it, merely typing the name of the document will start up the app. This proved very useful about an hour ago when I couldn’t figure out how to tell the Adobe Digital Editions ebook client how to open up a file I had sitting on a disk (they don’t need no stinkin’ “File” menu with an “Open” choice) so I entered the name of the .epub ebook file at the command line and it opened up in the Adobe reader.

By Ed Davies on October 19, 2007 2:09 PM

On Ubuntu I have a symlink:

lrwxrwxrwx 1 root root 19 2007-08-11 13:11 /usr/local/bin/go -> /usr/bin/gnome-open

which allows “go somedoc.pdf”, “go http://www.snee.com” or whatever. Naturally, “go .” opens Nautilus on the current directory, not that I use it much. The only snag is that it will only do one thing at a time; “go *.xml” only opens the first XML file in the directory.