查看Linux提供的Shell解析器

查看Linux提供的Shell解析器

Shell是一个命令行解释器,它接收应用程序/用户命令,然后调用操作系统内核。

1. 查看CentOS默认的解析器

[root@localhost home]# echo $SHELL
/bin/bash

2. Linux提供的解析器

[root@localhost home]# cat /etc/shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/bin/tcsh
/bin/csh

3. bash和sh的关系

  • 根据命令ls -l /bin/ | grep sh查看
    sh -> bash 可以知道sh是连接到bash来执行。
[root@localhost home]# ls -l /bin/ | grep sh
-rwxr-xr-x. 1 root root       2668 610 2014 amuFormat.sh
-rwxr-xr-x. 1 root root     964536 1125 2021 bash
lrwxrwxrwx. 1 root root         10 525 22:26 bashbug -> bashbug-64
-rwxr-xr-x. 1 root root       6964 1125 2021 bashbug-64
-rwxr-xr-x. 1 root root      19792 89 2019 cgsnapshot
-rws--x--x. 1 root root      23880 23 2021 chsh
-rwxr-xr-x. 1 root root    7565240 1117 2020 crash
lrwxrwxrwx. 1 root root          4 525 20:47 csh -> tcsh
-rwxr-xr-x. 1 root root      11576 82 2017 fipshmac
-rwxr-xr-x. 1 root root      15472 1119 2020 gdm-screenshot
-rwxr-xr-x. 1 root root       4629 41 2020 gettext.sh
-rwxr-xr-x. 1 root root      85568 112 2018 gnome-screenshot
-rwxr-xr-x. 1 root root      20544 831 2021 gnome-shell
-rwxr-xr-x. 1 root root    2157936 831 2021 gnome-shell-extension-prefs
-rwxr-xr-x. 1 root root       7331 831 2021 gnome-shell-extension-tool
-rwxr-xr-x. 1 root root      11686 831 2021 gnome-shell-perf-tool
lrwxrwxrwx. 1 root root         58 525 20:46 gnome-weather -> /usr/share/org.gnome.Weather/org.gnome.Weather.Application
-rwxr-xr-x. 1 root root        277 811 2022 gvfs-trash
-rwxr-xr-x. 1 root root       7712 101 2020 ksshell
-rwxr-xr-x. 1 root root      15864 413 2018 lchsh
-rwxr-xr-x. 1 root root      11416 116 2016 ldns-nsec3-hash
-rwxr-xr-x. 1 root root       2291 731 2015 lesspipe.sh
-rwxr-xr-x. 1 root root       5470 101 2020 lprsetup.sh
lrwxrwxrwx. 1 root root          6 525 20:32 mshortname -> mtools
lrwxrwxrwx. 1 root root          6 525 20:32 mshowfat -> mtools
-rwxr-xr-x. 1 root root      11600 416 2021 nettle-hash
-rwxr-xr-x. 1 root root      15352 1216 2020 pax11publish
-rwxr-xr-x. 1 root root      41872 37 22:54 regshell
-rwxr-xr-x. 1 root root      34620 41 2020 rescan-scsi-bus.sh
lrwxrwxrwx. 1 root root         18 525 22:28 scsi-rescan -> rescan-scsi-bus.sh
lrwxrwxrwx. 1 root root         19 525 22:27 setup-nsssysinit -> setup-nsssysinit.sh
-rwxr-xr-x. 1 root root       1539 321 00:12 setup-nsssysinit.sh
lrwxrwxrwx. 1 root root          4 525 22:26 sh -> bash
-rwxr-xr-x. 1 root root      37448 1117 2020 sha1sum
-rwxr-xr-x. 1 root root      41608 1117 2020 sha224sum
-rwxr-xr-x. 1 root root      41608 1117 2020 sha256sum
-rwxr-xr-x. 1 root root      41624 1117 2020 sha384sum
-rwxr-xr-x. 1 root root      41624 1117 2020 sha512sum
-rwxr-xr-x. 1 root root      35928 37 22:54 sharesec
-rwxr-xr-x. 1 root root      10371 513 2020 show-changed-rco
-rwxr-xr-x. 1 root root      15840 1125 2021 showconsolefont
-rwxr-xr-x. 1 root root      16572 513 2020 show-installed
-rwxr-xr-x. 1 root root      15600 1125 2021 showkey
-rwxr-xr-x. 1 root root       7248 812 2017 showrgb
-rwxr-xr-x. 1 root root      54208 1117 2020 shred
-rwxr-xr-x. 1 root root      50312 1117 2020 shuf
lrwxrwxrwx. 1 root root          5 525 22:28 slogin -> ./ssh
-rwxr-xr-x. 1 root root     774544 1125 2021 ssh
-rwxr-xr-x. 1 root root     360936 1125 2021 ssh-add
---x--s--x. 1 root nobody   382216 1125 2021 ssh-agent
-rwxr-xr-x. 1 root root      10469 1125 2021 ssh-copy-id
-rwxr-xr-x. 1 root root     419208 1125 2021 ssh-keygen
-rwxr-xr-x. 1 root root     441032 1125 2021 ssh-keyscan
-rwxr-xr-x. 1 root root      23920 126 00:37 sss_ssh_authorizedkeys
-rwxr-xr-x. 1 root root      28016 126 00:37 sss_ssh_knownhostsproxy
-rwxr-xr-x. 1 root root      23736 1014 2020 stapsh
-rwxr-xr-x. 1 root root        546 1031 2018 sushi
-rwxr-xr-x. 1 root root     404632 1117 2020 tcsh
-rwxr-xr-x. 1 root root       4165 101 2020 unix-lpr.sh
-rwxr-xr-x. 1 root root      15824 23 2021 unshare
-rwxr-xr-x. 1 root root      11424 812 2017 xrefresh
  • 根据命令 ls -l /bin/ | grep bash查看
[root@localhost home]# ls -l /bin/ | grep bash
-rwxr-xr-x. 1 root root     964536 1125 2021 bash
lrwxrwxrwx. 1 root root         10 525 22:26 bashbug -> bashbug-64
-rwxr-xr-x. 1 root root       6964 1125 2021 bashbug-64
lrwxrwxrwx. 1 root root          4 525 22:26 sh -> bash

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值