shell --判断语言是否能执行

[root@localhost etc]# lls && echo yes || echo no
bash: lls: command not found...
Similar command is: 'ls'
no
[root@localhost etc]# cd /usr/src
[root@localhost src]# ls
debug kernels
[root@localhost src]# ls && echo yes || echo no
debug kernels
yes
[root@localhost src]# lls && echo yes || echo no
bash: lls: command not found...
Similar command is: 'ls'
no
[root@localhost src]#
原文地址:https://www.cnblogs.com/clairedandan/p/13880920.html