Mihail Radu Solcan

  Start the command-line in the current folder

2009-01-04

An UNIX system is like a huge Integrated Development Environment. But, in order to use the environment, you have to type a lot of text in the command-line. Now, it is convenient to open a command-line prompt exactly where you want it to be. 

Under Windows, the command-line does not play the same role as in UNIX, but it is also convenient to open the MS-DOS Prompt or its newer versions where you need it. Changing directory is tedious. 

Nautilus scripts

Gnome is my favorite graphical user interface. It is the default GUI on Ubuntu and Fedora (see the Wikipedia list of systems using Gnome). Nautilus, the file manager for Gnome, has a nice feature: its context menu can be extended via scripts. The scripts must be placed in a special folder:

~/.gnome2/nautilus-scripts

I would put on top of the list of scripts command_prompt_here. You find it in the collection of scripts from pixelbeat. It does what its name suggests: you select a folder and the script opens a terminal with the working directory exactly there. 

Pixelbeat,created by Pádraig Brady , is one of the most useful sites for GNU/Linux users. See, for example, his Vim tips or the GNU/Linux command line reference

On Sourceforge there is a list of scripts for opening the terminal. Open_terminal_here is a Bash script that is very easy to adapt to various needs. For example, if you change the last line to

gnome-terminal --working-directory="$dir" -e 'wineconsole cmd 2>/dev/null'

the script will open a Wine Command Prompt in the selected directory. 

Nautilus plugin

There is a Nautilus extension named nautilus-open-terminal. It is available on Fedora. It is also available as an Ubuntu package. 

You can use this extension to open a terminal in the current folder. However, when you just select the folder, you have to use a Nautilus script. 

The MS-DOS Prompt

I stopped working on Windows in 2005. Thus my observations are bound to be outdated in 2009. They offer just hints. 

At least under Win98, if you press Start | Run and type

command

you get a Window which looks like an old school blackboard; this is the MS-DOS Prompt. Unfortunately it opens in the user's Desktop. You have to change directory in order to get where you want. 

Under Win98SE I used an excellent file manager, 2xExplorer. This file manager has a command-line. You get there pressing F10. 

If you want the full MS-DOS window, type in the 2xExplorer's command-line

command

This time you are in the current directory. 

On WinXP, the syntax of the commending changed. This time you start the shell with cmd.exe