1. 程式人生 > >Ubuntu12.04 設定當前目錄下開啟i終端

Ubuntu12.04 設定當前目錄下開啟i終端

用指令碼,把下面的指令碼儲存成任意名(我的是:開啟終端),然後放在主目錄的.gnome2/nautilus-scripts目錄下,當然你可以放一些其他常見的指令碼,都可以在右鍵找到。比如傳送到郵件/修改檔案許可權等等實用的功能。

指令碼:

#!/bin/bash
#
# This script opens a gnome-terminal in the directory youselect.
#
# 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 tocurrent
# directory. If more than one directory is selected, showerror.
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


相關推薦

Ubuntu12.04 設定當前目錄開啟i終端

用指令碼,把下面的指令碼儲存成任意名(我的是:開啟終端),然後放在主目錄的.gnome2/nautilus-scripts目錄下,當然你可以放一些其他常見的指令碼,都可以在右鍵找到。比如傳送到郵件/

當前目錄 開啟cmd

windows7 : 按住 shift 鍵 , 右鍵 就有該選項。 windows10 : 執行下面的 登錄檔檔案: 該登錄檔檔案內容如下: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT

nautilus-open-terminal----在當前目錄打開終端

select apt 相關 ted extension 錯誤 ati trac conf nautilus-open-terminal很有用的插件--鼠標右鍵打開終端 1.1 fedora安裝 # yum -y install nautilus-open-terminal

Linux如何設置在當前目錄打開終端

linux down util all apt sta wid 分享圖片 分享 轉:https://blog.csdn.net/iot_flower/article/details/71189816 1. sudo apt-get install nautilus-ope

Win7當前資料夾目錄開啟命令視窗cmd

  有時候我們想在計算機某個目錄下快速開啟cmd,並且將命令列路徑設定到該目錄當前路徑。其實操作很簡單,只需在任意目錄空白處,然後按住shift+滑鼠右擊,即可在看到如下狀態列:   點選即可進入

過濾當前目錄的一級目錄(不包含目錄目錄

一級目錄方法一[[email protected]/* */ ~]# ls -ltotal 56drwxr-xr-x. 2 root root 4096 Jul 2 09:48 a-rw-------. 1 root root 1079 Jun 9 07:12 anaconda-ks.cf

如何在當前目錄快速打開cmd(或者以管理員的身份打開)

方便 空白 tutorial light 很多 -1 mage for pen 1.在當前目錄下,按住shift鍵+點擊右鍵,選擇在此處打開命令窗口 很多時候我們需要打開命令行然後進入到相應目錄進行一些操作。 常規的做法是: D:\foo\bar", 然後輸入cd 再把復

三種方法在當前目錄打開cmd命令窗口

code 運行 star pos 也有 當前 最快 快捷鍵操作 post 概述 運行npm的時候,每次都要cd到目錄,很麻煩,所以總結了三種在當前目錄下直接打開cmd窗口的方法,供以後開發時參考,相信對其他人也有用。 方法一 在當前目錄按住shift再右鍵。 會看到右鍵菜

python 獲取當前目錄的文件目錄和文件名

文件目錄 spl list tdi files 文件的 span 兩個 utf os模塊下有兩個函數:   os.walk()   os.listdir() 1 # -*- coding: utf-8 -*- 2 3 import os

如何過濾出已知當前目錄oldboy中的所有一級目錄

3.4 dep 分隔符 member 排除 故障 多少 設置ip 如何解決 第1章 linux啟動過程 1.1 linux啟動過程(1) 開機自檢(BIOS)內存cup是否有問題(硬件檢查)(2) MBR引導(3) GRUB菜單(選擇不同的內核)(4) 加載內核(kerne

【Matlab轉換csv】將當前目錄面的csv檔案轉換.mat檔案

clear clc close all; % get file names file_names = dir('*.csv'); var_names = []; for i = 1 : numel(file_names) file_name = file_names(i).nam

Linux檢視當前目錄檔案/目錄數量

1) 統計當前資料夾下檔案的個數: ls -l |grep "^-"|wc -l   2) 統計當前資料夾下目錄的個數: ls -l |grep "^d"|wc -l   3) 統計當前資料夾下檔案的個數,包括子資料夾裡的 : ls -lR|grep

獲取當前目錄的有效圖片

獲取當前目錄下所有的子目錄 sub_dirs = [x[0] for x in os.walk(INPUT_DATA)] # 得到的第一個目錄是當前目錄,不需要考慮 is_root_dir = True for sub_dir in sub_dirs: if is_root_di

讀取,設定指定目錄的配置檔案的節點key value。config或XML

public static string GetValue(string key)//讀取指定節點 { XmlDocument doc = new XmlDocument(); string nodeVal = string.Empty

解壓當前目錄所有的 tar.gz

在tar.gz檔案所在的目錄下建立run.sh 內容為: for wav in ./*.tar.gz; do echo "Extracting wav from $wav" tar -zxf $wav && rm $wav done 新增執行許可權

py當前目錄建立時間目錄

import datetimeimport os# 當前時間nowTime = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S')# 當前時間目錄路徑pathStr = os.path.abspath('.') + "/" + nowTime# 是否存在

linux查詢當前目錄的所有檔案大小和清空檔案內容命令

  查詢當前目錄下的所有檔案大小:du -sh *  刪除檔案:rm - rf xxx.log 列印日誌:tail -f xxx.log 檢視程序ps -ef | grep java | grep -v grep 殺死客戶端kill -9 14569 - 啟動

錯誤解決:當前目錄有so,提示 error while loading shared libraries

  真是讓人莫名其妙……   ldd檢視 ldd gh_main linux-vdso.so.1 => (0x00007ffed294f000) libgh2mqtt.so (0x00007f4475a29000) libgh2mysql.so (0x0000