【问题标题】:close terminal by exit command on Centos6.7在 Centos6.7 上通过 exit 命令关闭终端
【发布时间】:2017-04-23 09:54:56
【问题描述】:

我正在使用 Centos 6.7,并且我想在没有更多要注销的子 shell 时关闭终端窗口。 如果我打开 Gnome 终端并输入“exit”,它只会打印“exit”而不是关闭终端窗口。 请帮忙 enter image description here

【问题讨论】:

    标签: terminal centos gnome


    【解决方案1】:

    如果您运行过子shell,您可能会看到这种行为,例如,之前输入shbash。您可以使用

    查看 shell(及其父进程 ID)
    ps -ef |grep bash | grep -v grep
    

    对于您已运行的每个级别的 shell,您应该退出该级别。或者您可以快速完成:

    pkill -9 bash
    

    但如果您以 root 身份运行(由 # 提示符暗示),则会产生不良的副作用(杀死您自己的子shell链之外的其他进程)。

    【讨论】:

      猜你喜欢
      • 2011-05-09
      • 1970-01-01
      • 2013-03-10
      • 1970-01-01
      • 1970-01-01
      • 2020-10-09
      • 2012-01-31
      • 2015-06-23
      • 1970-01-01
      相关资源
      最近更新 更多