QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 883|回复: 13

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

[复制链接]
发表于 2005-2-20 15:10:35 | 显示全部楼层 |阅读模式
是这样的,这一次我装RedHat 9 Linux为了防止某些起动项目设置倒至X启不来,我采取了从终端模式下命令起动KDE的方式,过去注销KDE后有图形登录介面,可以关机,可是在文字模式下我如何关机呢,而且我的ext3分区格式必须要求将程序unmount了。所以请教关机的命令是什么?
我现在的关机命令是reboot然后以迅雷不及掩耳之速度切断电源!
发表于 2005-2-20 15:23:57 | 显示全部楼层

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

使用道具 举报

发表于 2005-2-20 17:42:08 | 显示全部楼层
桌面新建一个应用程序链接,命令为:poweroff
回复

使用道具 举报

 楼主| 发表于 2005-2-20 20:27:24 | 显示全部楼层
6692975, 过去我有gnome时可以用shutdown now来关机,可是现在
[gj@localhost gj]$ shutdown --help
bash: shutdown: command not found
[gj@localhost gj]$ shutdown -h now
bash: shutdown: command not found
[gj@localhost gj]$ shutdown -h +1
bash: shutdown: command not found
是这种情况。
man shutdown是这样的
OPTIONS
       -a     Use /etc/shutdown.allow.

       -t sec Tell  init(  to wait sec seconds between sending processes the
              warning and the kill signal, before  changing  to  another  run-
              level.

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

       -r     Reboot after shutdown.

       -h     Halt after shutdown.

       -n     [DEPRECATED] Don't call init( to do the  shutdown  but  do  it
              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 option  it  is  of
              course not possible to give the time argument, but you can enter
              a explanatory message on the command line that will be  sent  to
              all users.

time   When to shutdown.

可是没有什么效用.
回复

使用道具 举报

发表于 2005-2-20 20:41:08 | 显示全部楼层
poweroff
init 0
回复

使用道具 举报

发表于 2005-2-20 21:19:25 | 显示全部楼层
whereis shutdown
看看它在哪里。
echo $PATH
看看你的PATH路径是否包括shutdown所在的路径。
回复

使用道具 举报

发表于 2005-2-20 21:28:13 | 显示全部楼层
/sbin?
回复

使用道具 举报

 楼主| 发表于 2005-2-20 22:20:26 | 显示全部楼层
是啊,多谢老师我用poweroff把机器关了.
回复

使用道具 举报

 楼主| 发表于 2005-2-20 22:24:07 | 显示全部楼层
[gj@localhost gj]$ 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添加进去呢?
回复

使用道具 举报

发表于 2005-2-20 23:23:29 | 显示全部楼层
PATH=$PATH:$HOME/bin ------>PATH=$PATH:$HOME/bin:/sbin
这么改一下就可以了。
回复

使用道具 举报

 楼主| 发表于 2005-2-21 09:17:47 | 显示全部楼层
多谢爱师,学生这就一试
回复

使用道具 举报

发表于 2005-2-21 11:39:49 | 显示全部楼层
[quote:8d154cdda7="lmp4h7"]6692975, 过去我有gnome时可以用shutdown now来关机,可是现在
[gj@localhost gj]$ shutdown --help
bash: shutdown: command not found
[gj@localhost gj]$ shutdown -h now
bash: shutdown: command not found
[gj@localhost gj]$ shutdown -h +1
bash: shutdown: command not found
可是没有什么效用.[/quote]


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

root试试
回复

使用道具 举报

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

使用道具 举报

 楼主| 发表于 2005-2-23 22:24:32 | 显示全部楼层
[gj@localhost sbin]$ shutdown
shutdown: you must be root to do that!
经过按照各位老师的教导我修改了/home/gj/.bash_profile这个文件的Path路径。提示了我以上信息,果然在根用户下可以使用该命令了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-25 17:13 , Processed in 0.081869 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表