CLI stands for Command Line Interface. An "interface" is a way for two systems to work with each other or for you to work with a system. On computers, users generally use interfaces in one of two ways:
- Graphical User Interfaces (also known as GUI's or UI's)
- Command Line Interfaces.
If you're new to programming, chances are you've only ever used the first one -- a GUI. Your operating system is a GUI, your smart phone has a GUI, websites like the one you're reading now is a GUI. In other words, the way you interact with the computer is through a more graphical representation of things like buttons, menus, tabs, forms, and links, etc.
The command line is where you interact with the computer by typing commands to execute programs or processes.
In this graphic below, anything after the %
is where we can type commands. Before the %
there's some information about my and my computer.
I typed cd ~/Desktop
to "change directory" to my desktop directory. Then I typed pwd
to "print the working directory". In other words, show me the full path for where we are on the computer. The next line shows %
with a white box ready for me to type the next command.
Some of the details might be a bit different. Depending on the situation it might be a $
instead of a %
. The information before the %
can be different depending on the machine. There's also a fairly big difference between the different "command line shells" -- which is the program that coordinates the commands and what they do. On Windows for instance, it's common to use PowerShell, while on Mac and Linux it's popular to use Bash and ZSH. Something like "changing a directory" can be similar or very different between the different shells.