编辑一些系统文件时
提示没有权限
不知道在不退出emacs的前提下
如何取得root权限呢?
[问题] emacs 如何取得root权限?
-
- 帖子: 39
- 注册时间: 2006-06-02 10:42
-
- 帖子: 45
- 注册时间: 2007-01-27 14:11
- jiangpeng
- 帖子: 223
- 注册时间: 2006-07-25 9:33
- 联系:
sudo emacs 

Take what man makes and use it, But do not worship it, For it shall pass. -- Anonymous
Twitter @jiangpeng
Twitter @jiangpeng
- zhan
- 帖子: 1880
- 注册时间: 2005-08-15 0:04
- 来自: 南7技校
比如打开 /etc/apt/sources.list
C-x C-f /sudo:[root@]
方括号中是提示,直接回车,又提示 [localhost] 再回车,就会在 echo buffer 出现输入密码的 提示,输入了,就可以了,然后找你要的文件 /etc/apt/sources.list
直接编辑,保存就是了。
C-x C-f /sudo:[root@]
方括号中是提示,直接回车,又提示 [localhost] 再回车,就会在 echo buffer 出现输入密码的 提示,输入了,就可以了,然后找你要的文件 /etc/apt/sources.list
直接编辑,保存就是了。
飞得高,飞得低,学习再学习,多少大秘密!
http://zhan.blog.ubuntu.org.cn
http://zhan.blog.ubuntu.org.cn
- cheneymx
- 帖子: 159
- 注册时间: 2007-03-13 4:59
- 来自: Erlangen
- zhan
- 帖子: 1880
- 注册时间: 2005-08-15 0:04
- 来自: 南7技校
看应用了。
再说,这是完全没有配置 tramp 的时候的操作,我个人觉得完全可以配置 tramp 来达到透明的操作。
具体的我还没有看 tramp 的手册,所以不好说。
再说,如果你用 emacs 多半编辑自己的文件,少数是编辑系统文件的话,重启绝对不是一个好的办法。^_^
个人意见....
再说,这是完全没有配置 tramp 的时候的操作,我个人觉得完全可以配置 tramp 来达到透明的操作。
具体的我还没有看 tramp 的手册,所以不好说。
再说,如果你用 emacs 多半编辑自己的文件,少数是编辑系统文件的话,重启绝对不是一个好的办法。^_^
个人意见....
飞得高,飞得低,学习再学习,多少大秘密!
http://zhan.blog.ubuntu.org.cn
http://zhan.blog.ubuntu.org.cn
-
- 帖子: 45
- 注册时间: 2007-01-27 14:11
Firstly I'm sorry I'm in an English env so input in English.cheneymx 写了:... 那我觉得还是重启emacs比较简单吧.zhan 写了:比如打开 /etc/apt/sources.list
C-x C-f /sudo:[root@]
方括号中是提示,直接回车,又提示 [localhost] 再回车,就会在 echo buffer 出现输入密码的 提示,输入了,就可以了,然后找你要的文件 /etc/apt/sources.list
直接编辑,保存就是了。
With tramp, you can visit a directory with C-x d /... then you take the control all over any subdirectories and files in the directory you visited, with the privilege of the user you provide to tramp (not restricted to root of course). And what's more, the directory you type in C-x d ... is not limited to the directories on localhost, it could reside on a remote server. For example, C-x C-f /ssh:user@machine:... And you can even compile with tramp! All the underlying connection is transparent once you have visited files/directories with tramp.
Tramp comes with Emacs >= 22. If you have installed Emacs >= 22, tramp is probably already installed. Type C-h i m tramp RET to read the manual.