This has probably been covered before, but I couldn`t see it anywhere...
Anyway, this is a quick method of dropping to a terminal from nautilus, which automatically changes directory to wherever you were browsing with nautilus. (For any local location - won`t work with ftp or other esoteric locations).
Big thanks to the guys in the Drag and Drop To Run As Root HOWTO thread for showing me how this could be achieved.
HOWTO: Quickly Open a Terminal From Nautilus
- Open a Terminal
- Type:
Code:
cd ~/.gnome2/nautilus-scripts
- Type:
Code:
gedit Open\ Terminal\ Here
- Paste the following code into the file:
Code:
#!/bin/sh
# From Chris Picton
# Replaces a Script by Martin Enlund
# Modified to work with spaces in path by Christophe Combelles
# This script either opens in the current directory,
# or in the selected directory
base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
if [ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
dir="$base"
else
while [ ! -z "$1" -a ! -d "$base/$1" ]; do shift; done
dir="$base/$1"
fi
gnome-terminal --working-directory="$dir"
- Save the gedit file, and quit.
- Back in the terminal type:
Code:
chmod +x Open\ Terminal\ Here
et voila....
In any nautilus window, you can right click, and from the scripts sub-context-menu, click on Open Terminal Here to open a terminal at the currently viewed directory.
[EDIT] You can now highlight a folder and perform the operation to open a terminal at the location highlighted.
Hope somebody besides me finds this useful - the lack of this option has driven me batty since my foray into linux.
Bookmarks