小智 7
在 MacOS 中,以下命令将列出系统上可用的 shell
$ ls -l /bin/*sh
-r-xr-xr-x 1 root wheel 618448 Nov 19 00:26 /bin/bash
-rwxr-xr-x 1 root wheel 380016 Feb 7 16:11 /bin/csh
-r-xr-xr-x 1 root wheel 1287040 Sep 21 00:35 /bin/ksh
-r-xr-xr-x 1 root wheel 618512 Nov 19 00:26 /bin/sh
-rwxr-xr-x 1 root wheel 380016 Feb 7 16:11 /bin/tcsh
-rwxr-xr-x 1 root wheel 610288 Sep 21 00:35 /bin/zsh
Run Code Online (Sandbox Code Playgroud)
简单的方法是去/etc检查shells文件.内容是Mac OSX中可用的shell列表.
默认包括:
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
Run Code Online (Sandbox Code Playgroud)
或者,您可以通过/bin直观地识别它们来检查它们的二进制文件.当然,您必须了解它们才能识别它们.