Definitions
GUI
GUI or Graphical User Interface is user interface type that allows users to interact through visual and graphic such as images, buttons, tabs, scroll bars... It's everywhere, it is like the default type of interface, the definition of user interface is self. All websites, smartphone interfaces, and the default file manager on your computer are all using GUI.
TUI
TUI or Text-based User Interface is like GUI but instead of having visual and graphic, everything is displayed in text. Characters can be bold, italic, underlined, uppercase, lowercase, blinking, with any foreground or/and background color... But the text must always be mono characters (on grid). We will mainly see this type of interface on software run on terminal such as text editor, media player, task manager...
CLI
CLI or Command Line Interface is an interface where the only way to interact is to write commands through a prompt and send it, the software will then return a results, and the user is allowed to type and send commands again.
Software that uses CLI typically includes shells such as Bash, Zsh, Nushell... Some REPL (read-eval-print loop) for programing languages like Python, Ruby, ... And other tools like nmcli
, bc
, fend
, clifm
... But note that software that uses the CLI interface to display content inside it is not CLI software, but it is TUI.
CLI software is software run as command inside a shell, for example ls
, cp
, mv
, rm
, cal
, neofetch
, ... The general pattern of CLI softwares are like:
command parameter --flag
CLI > GUI (and TUI)
- CLI seems difficult to use and learn at first. But once you get used to it, you can operate in shell really fast and flexible. Using CLI is like programming a simple software and runs it at the same time.
- Most CLI tool launch and process in a blink, reduce friction in your workflow.
- There is a giant library of cool and useful CLI tools that allow you to do things that few GUI/TUI software can do. Many tools give you the freedom to do all kinds of things with your computer. You can fix, change or break the entire operating system if you want.
- Using CLI is powerful in that we can connect separate software to work together by taking
stdout
(standard output) of a software and used it asstdin
(standard input) for another software. We call this pipe/piping. Two or more software connected together in this way is called a pipeline.
Here is an example of a pipeline (the echo
command prints a string. rev
reverses the input data. figlet
turns strings into large ASCII letters. tee
read from standard input and write to standard output and files, which a "files" can be a terminal output. Finally, the command cb
copy input data to the clipboard):
$ echo '!dlroW ,olleH' | rev | figlet | tee /dev/tty | cb
_ _ _ _ __ __ _ _ _
| | | | ___| | | ___ \ \ / /__ _ __| | __| | |
| |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | |
| _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|
|_| |_|\___|_|_|\___( ) \_/\_/ \___/|_| |_|\__,_(_)
|/
[✔] Copied 336B