12.1 确定你的Shell版本

如果你安装的Linux是RedHat、CentOS、Fedora、Ubuntu、Debian等主流发行版,那么在你的系统中很可能已经预装了Bash Shell,只需要确认一下是否确实已经安装以及预装的版本即可。具体的方法是:


#

确认系统中使用的Shell

是bash

[root@localhost ~]# echo $SHELL

binbash

#

查看系统中Bash Shell

的版本(方法一)

[root@localhost ~]# bash —version

GNU bash, version 3.2.25(1)-release (i686-redhat-linux-gnu)

Copyright (C) 2005 Free Software Foundation, Inc.

#

查看系统中Bash Shell

的版本(方法二)

[root@localhost ~]# echo $BASH_VERSION

3.2.25(1)-release