First of all we have to know what is interface. Interface is a connection between user and computer. Like a screen is an interface between us and computer. As we understand interface we can now move on by explaining what actually is GUI and CLI.
GUI stands for Graphical user interface is an interface in which keyboard, mouse, I/O devices are used to perform actions.
CLI stands for Command line tools is an interface in which keyboard is mostly used to type commands and it interacts with computer.
Difference between GUI and CLI:-
Let me discuss about some differences between Graphical user interface (GUI) and Command line interface (CLI).
CLI is mostly used by computer programmers or experts and it is difficult for new comer to use this interface. While GUI is easy to use for both new and experienced users.
In CLI, there is few multitasking involved or may be no multitasking is used in most cases. On the other hand if we take example of MS word or any other software like chrome, we have multitasking in which many tasks are performed at the same time, like spell checking, connecting to internet etc.
If we code in Command line tool then it is difficult for us to detect errors and syntax hinting not works while in GUI tool like sublime Text (coding editor) we get syntax hinting and error notification in writing code.
Handling complex tasks:-
Some complex tasks can be done quickly in CLI by writing few commands while in GUI we have to follow many steps to make that work.
GUI uses more resources as it has multitasking involved in it while CLI use only keyboard and system to interact with user.
Fast or slow:-
GUI becomes slow sometimes and takes time in loading and performing tasks while CLI perform fast.
If you want to access any other computer remotely then GUI is preferred way for new users while connecting with command line interface is difficult
In CLI it is difficult for anyone to remember all commands to perform any task. But the interface remains same most of time. In GUI the elements like buttons, menus, interface change on updating of software.
As we have to not shift to other programs in CLI, it is color strain to our eyes while in GUI we shift attention between colors and windows it becomes less strain.
If you are programmer then you have more control over system through command line interface. In graphical user interface there is some limitation to access files and folders and privilege to perform some tasks.
Memory and disk space usage:-
CLI uses less memory and disk space while GUI consumes lot of memory and disk space.
Examples of GUI and CLI:-
In windows MS dos is command line interface while MS word is graphical user interface.