Go to the. gnome2/Nautilus-scripts directory of the main directory (root user. Create a new file with any file name (the file name will be displayed in the right-click menu, "Open-terminal"). The file content is as follows.
#! /Bin/bash
#
# This script opens a gnome-terminal in the directory you select.
#
# Distributed under the terms of gnu gpl version 2 or later
#
# Install in ~ /. Gnome2/Nautilus-scripts or ~ /Nautilus/scripts
# You need to be running Nautilus 1.0.3 + to use scripts.
# When a directory is selected, go there. Otherwise go to current
# Directory. If more than one directory is selected, show error.
If [-n "$ nautilus_script_selected_file_paths"]; then
Set $ nautilus_script_selected_file_paths
If [$ #-EQ 1]; then
Destination = "$1"
# Go To File's directory if it's a file
If [! -D "$ destination"]; then
Destination = "'dirname" $ destination "'"
Fi
Else
Zenity -- error -- Title = "error-open terminal here ""
-- Text = "You can only select one directory ."
Exit 1
Fi
Else
Destination = "'echo" $ nautilus_script_current_uri "| SED's/^ file :"/"///''"
Fi
# It's only possible to go to local directories
If [-n "'echo" $ destination "| grep '^ [a-zA-Z0-9]" +: ''"]; then
Zenity -- error -- Title = "error-open terminal here ""
-- Text = "only local directories can be used ."
Exit 1
Fi
Cd "$ destination"
Exec X-terminal-emulator
After adding the file, add executable permissions to the file.
Chmod + x open-Terminal
Let's talk about the advantages and disadvantages of this method:
1. this method first creates a level-2 menu. It first adds a menu named scripts to the context menu, which is the "open-terminal" we need, so it seems inconvenient.
2. it is based on Nautilus and identifies the current directory. By default, the opened terminal is the current directory, which is user-friendly. No matter what directory you are in, the default directory is the main directory.
The second method has great scalability. If you can write your own scripts, You can implement many custom functions, such as sending emails or modifying file permissions.