Chinaunix首页 | 论坛 | 博客
  • 博客访问: 583752
  • 博文数量: 69
  • 博客积分: 2204
  • 博客等级: 大尉
  • 技术积分: 808
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-11 22:37
个人简介

..微笑着看着杯中的花茶一片片撑开.. ..透明的花瓣里水破开的声音很轻微..

文章分类

全部博文(69)

文章存档

2018年(1)

2017年(2)

2016年(10)

2015年(8)

2014年(6)

2013年(6)

2012年(4)

2011年(8)

2010年(12)

2009年(12)

分类: LINUX

2009-10-20 15:12:30

使用Ubuntu经常需要使用终端或者用管理员身份来打开某个文件夹进行拷贝之类的事情,在右键菜单里添加上这两个命令无疑省了我们很多不必要的麻烦。网上介绍了几种方法,现在把方法记录下来,以备查询。

1.在终端中打开

第一种方法:
安装一个包,即可在右键里面添加一个“打开终端”的菜单。
sudo apt-get install nautilus-open-terminal


第二种方法:
进入主目录的.gnome2/nautilus-scripts目录。新建一个文件,文件名任意(这个文件名会显示在右键菜单里,最好是通俗易懂的,比如“打开终端”或“open-terminal”),文件内容如下。

#!/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


添加完后,把此文件加上可执行的权限。
chmod +x 文件


2.以管理员身份打开

第一种方法:
打开[新立得],搜索 nautilus-gksu,并安装。重启X后就能在右键中看到这个选项了。

第二种方法:

1、安装程序“Ubuntu Tweak”,关于Ubuntu Tweak的介绍请看: []

2、在“应用程序”菜单--“系统工具”中打开Ubuntu Tweak。

3、个人设定--脚本--启用脚本“作为root浏览”和“使用文本编辑器打开(作为root)”。

4、用鼠标右键单击任一文件夹或文件,选择“以管理员打开”,就可以进行你想要做的操作了。



(2009-10-20)

by banban
阅读(2049) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-10-21 13:37:30

小媳妇