什么是CLI?(程序)
命令行界面(CLI)是一种基于文本届面(类似:MacOS终端、Windows cmd.exe),用于运行程序。(A command-line interface(CLI) is a text-based user interface(UI) used to run programs,manage computer files and interact with the computer.Command-line interfaces are also calles command-line user interfaces,console user interfaces and character user interfaces.)
CLI接受键盘输入,在命令提示符处输入命令,然后由计算机执行并返回结果。(CLIs accept as input commands that are entered by keyboard;the commands invoked at the command prompt are then tun by the computer.)
今天大部分操作系统都会以GUI作为基础,但是基于Unix的系统都会同时提供CLI和GUI.(Today,most vendors offer the graphical user interface(GUI) as the default for operating systems(OSes)such as Windows,Linus and macOS.Most current Unix-based systems offer both a command-line interface and a graphical user interface.)
总结
Shell是操作系统提供的接口程序,用于接收用户输入的命令,交给操作系统内核执行并接收响应结果。(抽象)
Bash 是Shell 的一个实现,用于执行用户输入的命令
CLI是Bash的运行环境,CLI接收用户键盘输入,交给Bash执行,并将程序处理结果以文本形式进行显示。