Ele*_*ila 0 command-line nautilus
我在 Ubuntu 14.04 上。
这是我运行“nautilus /”时发生的情况。程序运行,终端进入下一个命令行。完美。(http://postimg.org/image/9cpyfjqvp/)
但是当我尝试运行“sudo nautilus /”时会发生什么。程序运行时,但显示错误消息,并且终端也不会转到下一命令行。( http://postimg.org/image/3ptli2od1/ )
下面是当我尝试使用 Control+Z 在不关闭程序的情况下转到下一个命令行时发生的情况。该程序完全冻结,需要强制退出。好吧,情况更糟。(http://postimg.org/image/m6o08w4b9/)
这是当我尝试“sudo nautilus /&”时发生的情况。该程序实际上甚至没有运行,然后显示一条错误消息,并且无法将我留在命令行上。(http://postimg.org/image/pg2ffcset/)
我尝试 Control+C,然后“退出”,却发现显然有停止的作业。这很......奇怪,但我认为它可能值得截图,以防它意味着什么。(http://postimg.org/image/3uxcrqvo5/)
重新启动计算机后,“sudo nautilus /&”实际上什么也没做。它甚至不询问我的密码,或者给我一条错误信息,或任何东西。(http://postimg.org/image/cscab8dbl/)
但是“sudo nautilus /”显然仍然有效,但仍存在与以前相同的问题。(http://postimg.org/image/7icu68fcx/)
使用左上角的 X 按钮退出程序后,一堆错误消息被泵入终端窗口,但幸运的是我在一个新的命令行上掉线了。(http://postimg.org/image/6vdxgpigx/)
奇怪的是,这一次,我仍然可以使用“sudo nautilus /”。(http://postimg.org/image/re8tlrwe9/)
使用 Control+C 退出程序会产生零错误消息,但是之后使用“exit”会显示另一个停止的进程。(http://postimg.org/image/pyfrxwox3/)
如何从终端以管理员身份运行 Nautilus,然后转到下一个命令行?!
gksudo 似乎合适:
gksudo nautilus / &
Run Code Online (Sandbox Code Playgroud)
从gksudo手册页:
gksu is a frontend to su and gksudo is a frontend to sudo. Their pri?
mary purpose is to run graphical commands that need root without the
need to run an X terminal emulator and using su directly.
Run Code Online (Sandbox Code Playgroud)
注意:如果gksudo您的 Ubuntu 版本不可用,您可以通过以下方式获取:
sudo apt-get install gksu
Run Code Online (Sandbox Code Playgroud)