sudo -s
将像普通用户一样在当前目录中运行命令。例如:
rick@alien:~/askubuntu$ suspendtime
Nov 12 14:06:27 to Nov 12 17:22:21 lasting 11,754 seconds
Nov 12 22:23:37 to Nov 13 04:24:37 lasting 21,660 seconds
(... SNIP ...)
Dec 02 21:58:49 to Dec 03 04:20:52 lasting 22,923 seconds
Dec 03 05:52:43 to Dec 03 16:37:44 lasting 38,701 seconds
Linux uptime 1,859,356 seconds (21 days, 12 hours, 29 minutes, 16 seconds)
45 Suspends 1,173,341 seconds (13 days, 13 hours, 55 minutes, 41 seconds)
Real uptime 686,015 seconds (7 days, 22 hours, 33 minutes, 35 seconds)
rick@alien:~/askubuntu$ sudo suspendtime
sudo: suspendtime: command not found
rick@alien:~/askubuntu$ sudo -H suspendtime
sudo: suspendtime: command not found
rick@alien:~/askubuntu$ sudo -s suspendtime
Nov 12 14:06:27 to Nov 12 17:22:21 lasting 11,754 seconds
(...SNIP...)
Dec 03 05:52:43 to Dec 03 16:37:44 lasting 38,701 seconds
Linux uptime 1,859,431 seconds (21 days, 12 hours, 30 minutes, 31 seconds)
45 Suspends 1,173,341 seconds (13 days, 13 hours, 55 minutes, 41 seconds)
Real uptime 686,090 seconds (7 days, 22 hours, 34 minutes, 50 seconds)
当然,使用-s
而不是给命令加上前缀./
可能不会节省很多时间。