lmp4h7 发表于 2005-2-20 15:10:35

KDE环境而且用文字方式登录起动X只有注销无关机方法怎么办?

是这样的,这一次我装RedHat 9 Linux为了防止某些起动项目设置倒至X启不来,我采取了从终端模式下命令起动KDE的方式,过去注销KDE后有图形登录介面,可以关机,可是在文字模式下我如何关机呢,而且我的ext3分区格式必须要求将程序unmount了。所以请教关机的命令是什么?
我现在的关机命令是reboot然后以迅雷不及掩耳之速度切断电源!

6692975 发表于 2005-2-20 15:23:57

:shock:
shutdown -h now 立刻关机
shutdown -h +20 二十分后关机
man shutdown 查看相关参数及使用方法。

月下刀客 发表于 2005-2-20 17:42:08

桌面新建一个应用程序链接,命令为:poweroff

lmp4h7 发表于 2005-2-20 20:27:24

6692975, 过去我有gnome时可以用shutdown now来关机,可是现在
$ shutdown --help
bash: shutdown: command not found
$ shutdown -h now
bash: shutdown: command not found
$ shutdown -h +1
bash: shutdown: command not found
是这种情况。
man shutdown是这样的
OPTIONS
       -a   Use /etc/shutdown.allow.

       -t sec Tellinit(8)to wait sec seconds between sending processes the
            warning and the kill signal, beforechangingtoanotherrun-
            level.

       -k   Don'treally shutdown; only send the warning messages to every-
            body.

       -r   Reboot after shutdown.

       -h   Halt after shutdown.

       -n    Don't call init(8) to do theshutdownbutdoit
            ourself.The use of this option is discouraged, and its results
            are not always what you'd expect.

       -f   Skip fsck on reboot.

       -F   Force fsck on reboot.

       -c   Cancel an already running shutdown. With this optionitisof
            course not possible to give the time argument, but you can enter
            a explanatory message on the command line that will besentto
            all users.

time   When to shutdown.

可是没有什么效用.

潇湘馆主 发表于 2005-2-20 20:41:08

poweroff
init 0

6692975 发表于 2005-2-20 21:19:25

whereis shutdown
看看它在哪里。
echo $PATH
看看你的PATH路径是否包括shutdown所在的路径。

潇湘馆主 发表于 2005-2-20 21:28:13

/sbin?

lmp4h7 发表于 2005-2-20 22:20:26

是啊,多谢老师我用poweroff把机器关了.

lmp4h7 发表于 2005-2-20 22:24:07

$ whereis shutdown
shutdown: /sbin/shutdown /usr/share/man/man2/shutdown.2.gz /usr/share/man/man8/shutdown.8.gz

我现在的.bash_profile 的Path路径是这样设的:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs


PATH=$PATH:$HOME/bin
export PATH
unset USERNAME

JAVA_HOME=/home/gj/j2sdk1.4.2_06
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.;$JAVA_HOME/lib/tools.jar;$JAVA_HOME/jre/lib/rt.jar
export JAVA_HOME PATH CLASSPATH


接下来我用什么语法将shutdown添加进去呢?

6692975 发表于 2005-2-20 23:23:29

PATH=$PATH:$HOME/bin ------>PATH=$PATH:$HOME/bin:/sbin
这么改一下就可以了。

lmp4h7 发表于 2005-2-21 09:17:47

多谢爱师,学生这就一试

topsec 发表于 2005-2-21 11:39:49

6692975, 过去我有gnome时可以用shutdown now来关机,可是现在
$ shutdown --help
bash: shutdown: command not found
$ shutdown -h now
bash: shutdown: command not found
$ shutdown -h +1
bash: shutdown: command not found
可是没有什么效用.


$模式可以关机吗?搞不懂。。。

root试试

lmp4h7 发表于 2005-2-23 22:18:40

topsec, 对对,我在前段时间研究这个问题时发现,root目录下有shutdown的东东,而我的/home/gj下的.*文件里并没有shutdown任何记录,当时没有反应过来,只是没有勇气在根用户下做任何试验,我对于Linux只把home/gj做为自己的学习环境。现在由于过年期间,我只用poweroff, 没有研究shutdown我过去用过shoutdown now等关机命令,那时可能是因为我的rh9中有gnome的原因。我回来试上一试.在这里告诉各位老师。

lmp4h7 发表于 2005-2-23 22:24:32

$ shutdown
shutdown: you must be root to do that!
经过按照各位老师的教导我修改了/home/gj/.bash_profile这个文件的Path路径。提示了我以上信息,果然在根用户下可以使用该命令了。
页: [1]
查看完整版本: KDE环境而且用文字方式登录起动X只有注销无关机方法怎么办?