国产宅男网站在线|亚洲A级性爱免费视频|亚洲中精品级在线|午夜福利AA毛

  • <dd id="gf5jf"><th id="gf5jf"></th></dd>

    <cite id="gf5jf"><label id="gf5jf"></label></cite>
  • <div id="gf5jf"><listing id="gf5jf"></listing></div>
    學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 > 怎么查看Linux中的shell指南

    怎么查看Linux中的shell指南

    時(shí)間: 春健736 分享

    怎么查看Linux中的shell指南

      許多人都不知道自己的Linux系統(tǒng)使用的是哪種shell,下面學(xué)習(xí)啦小編就教你如何查看Linux系統(tǒng)中使用的shell的方法,一起來(lái)了解下吧。

      查看Linux中的shell指南的方法

      查看當(dāng)前發(fā)行版可以使用的shell

      代碼如下:

      [root@localhost ~]$ cat /etc/shells

      /bin/sh

      /bin/bash

      /sbin/nologin

      查看當(dāng)前使用的shell方法

      一、最常用的查看shell的命令,但不能實(shí)時(shí)反映當(dāng)前shell

      代碼如下:

      [root@localhost ~]$ echo $SHELL

      /bin/bash

      二、下面這個(gè)用法并不是所有shell都支持

      代碼如下:

      [root@localhost ~]$ echo

    怎么查看Linux中的shell指南

    時(shí)間: 春健736 分享

    怎么查看Linux中的shell指南

      許多人都不知道自己的Linux系統(tǒng)使用的是哪種shell,下面學(xué)習(xí)啦小編就教你如何查看Linux系統(tǒng)中使用的shell的方法,一起來(lái)了解下吧。

      查看Linux中的shell指南的方法

      查看當(dāng)前發(fā)行版可以使用的shell

      代碼如下:

      [root@localhost ~]$ cat /etc/shells

      /bin/sh

      /bin/bash

      /sbin/nologin

      查看當(dāng)前使用的shell方法

      一、最常用的查看shell的命令,但不能實(shí)時(shí)反映當(dāng)前shell

      代碼如下:

      [root@localhost ~]$ echo $SHELL

      /bin/bash

      二、下面這個(gè)用法并不是所有shell都支持

      代碼如下:

      [root@localhost ~]$ echo

      -bash

      三、環(huán)境變量中shell的匹配查找

      代碼代碼如下:

      [root@localhost ~]$ env | grep SHELL

      SHELL=/bin/bash

      四、口令文件中shell的匹配查找

      代碼如下:

      [root@localhost ~]$ cat /etc/passwd | grep root

      root:x:0:0:root:/root:/bin/bash

      五、查看當(dāng)前進(jìn)程

      代碼如下:

      [root@localhost ~]$ ps

      PID TTY TIME CMD

      3052 pts/0 00:00:00 bash

      3254 pts/0 00:00:00 ps

      六、先查看當(dāng)前shell的pid,再定位到此shell進(jìn)程

      代碼如下:

      [root@localhost ~]$ echo $$

      1862

      [root@localhost ~]$ ps -ef | grep 1862

      root 1862 1860 0 01:50 pts/0 00:00:00 -bash

      root 2029 1862 0 02:07 pts/0 00:00:00 ps -ef

      root 2030 1862 0 02:07 pts/0 00:00:00 grep 1862

      七、輸入一條不存的命令,查看出錯(cuò)的shell提示

      代碼如下:

      [root@localhost ~]$ asdf

      bash: asdf: command not found

      附:一條命令即可實(shí)現(xiàn):

      代碼如下:

      [root@localhost ~]$ ps -ef | grep `echo $$` | grep -v grep | grep -v ps

      root 1862 1860 0 01:50 pts/0 00:00:00 -bash

      上面就是Linux下查看使用的是哪種shell的方法的介紹了,如果你不知道你的電腦使用的是哪種shell,不妨試試上面介紹的方法吧。

    648086