- Foundation
- About 15 min
- 5 practice questions
GUI and CLI: two ways to give commands, on Windows and Linux
Compare graphical and command-line interfaces, use a few basic commands on Linux and Windows, and find the Linux desktop equivalent of familiar Windows features.
If something looks wrong, please tell us.
There are two main ways to tell a computer what to do: point and click on pictures, or type commands. Both are still used every day. Knowing both, and knowing how Windows and Linux name the same things, makes you comfortable on any computer.
Command-line interface (CLI)
In a command-line interface you type a command at a prompt and press Enter; the computer replies in text. Early personal computers ran MS-DOS, a CLI. Today you use a CLI through the Terminal on Linux (running a shell such as bash) or the Command Prompt or PowerShell on Windows. A CLI is fast for experienced users, can repeat a task on many files with one command or a script, and needs few resources, but you must remember the commands and type them exactly.
Graphical user interface (GUI)
In a graphical user interface you work with pictures on the screen using a mouse, touchpad or touch. Its four building blocks are remembered as WIMP: Windows, Icons, Menus and a Pointer. A GUI is easy to learn because you can see your choices, but it needs more memory and processing power. Windows, macOS and Linux desktop environments such as GNOME, KDE Plasma, Xfce and MATE are GUIs.
GUI or CLI?
-
GUI
- Click, double-click, drag, touch
- Easy for beginners: choices are visible
- Slower for repeated tasks
- Needs more memory and graphics power
- Windows desktop, GNOME, KDE Plasma
-
CLI
- Type a command and press Enter
- Harder: commands must be remembered
- Faster: one command or script does many
- Needs very little
- Linux Terminal, Windows Command Prompt
| Point | GUI | CLI |
|---|---|---|
| How you give commands | Click, double-click, drag, touch | Type commands and press Enter |
| Ease for beginners | Easy: choices are visible | Harder: commands must be remembered |
| Speed for repeated tasks | Slower: one click at a time | Faster: one command or script can do many |
| Resources needed | More memory and graphics power | Very little |
| Examples | Windows desktop, GNOME, KDE Plasma | Linux Terminal, Windows Command Prompt |
A few basic commands
| Task | Linux terminal | Windows Command Prompt |
|---|---|---|
| List the files in the current folder | ls | dir |
| Change to another folder | cd foldername | cd foldername |
| Show the current folder | pwd | cd (with nothing after it) |
| Make a new folder | mkdir name | mkdir name (or md name) |
| Copy a file | cp source destination | copy source destination |
| Move or rename a file | mv old new | move (to move), ren (to rename) |
| Delete a file | rm filename | del filename |
| Clear the screen | clear | cls |
Linux commands and file names are case-sensitive: ls works but LS usually gives 'command not found'. Windows commands are not case-sensitive.
Linux desktop and Windows equivalents
| Windows | Linux desktop (names vary by desktop environment) |
|---|---|
| Start menu | Applications menu, launcher or activities overview |
| Taskbar | Panel or dock |
| File Explorer | File manager (for example Files or Dolphin) |
| Recycle Bin | Trash |
| Control Panel or Settings | System Settings |
| Task Manager | System Monitor |
| Command Prompt | Terminal |
| Administrator account | root user; ordinary users run admin tasks with sudo |
| C: drive | / (the root directory) |
Worked example 1: the same task both ways
Task: make a folder called notes and check that it exists. On Linux: type mkdir notes and press Enter, then type ls; notes appears in the list. On Windows: type mkdir notes, then dir. In a GUI on either system: open the file manager, right-click an empty area, choose the New Folder option, type notes and press Enter. Same result, three routes.
Worked example 2: which interface suits whom?
A first-time user who wants to write a letter should use a GUI: everything is visible and needs no memorised commands. A system administrator who must rename 500 log files every night should use a CLI script: one command does all 500 without clicking each file. Neither interface is 'better'; each suits a different job.
GUI = WIMP: Windows, Icons, Menus, Pointer. CLI = type a command, press Enter. Linux: ls, cd, pwd, mkdir, cp, mv, rm. Windows: dir, cd, mkdir, copy, move, del.
Key takeaways: a GUI is easy to learn and visual; a CLI is fast, scriptable and light. Linux commands are case-sensitive. Learn the equivalents: Recycle Bin and Trash, Task Manager and System Monitor, Command Prompt and Terminal, Administrator and root.
Check your understanding
-
1. In GUI terms, WIMP stands for:
- Windows, Icons, Menus, Pointer
- Words, Images, Mouse, Printer
- Web, Internet, Mail, Programs
- Windows, Internet, Memory, Processor
Show answer
Answer: A. A graphical interface is built from windows, icons, menus and a pointer controlled by a mouse, touchpad or touch.
-
2. Which Linux command lists the files in the current folder?
- cd
- pwd
- ls
- mkdir
Show answer
Answer: C. ls lists the contents of the folder. cd changes the folder, pwd shows the current folder's path and mkdir makes a new folder.
-
3. Which of these is a feature of a command-line interface rather than a GUI?
- You click icons with a mouse
- You type commands at a prompt
- Programs open in windows with title bars
- You drag files from one folder to another
Show answer
Answer: B. In a CLI you type commands and press Enter. Clicking icons, windows with title bars and dragging files are all features of a GUI.
-
4. What is the Linux desktop equivalent of the Windows Recycle Bin?
- Terminal
- Panel
- Kernel
- Trash
Show answer
Answer: D. Linux desktops keep deleted files in the Trash until it is emptied, as Windows does with the Recycle Bin. The Terminal is the command line, the panel is like the taskbar, and the kernel is the core of the OS.
-
5. On Linux, typing LS instead of ls usually gives an error. Why?
- Linux commands are case-sensitive
- LS is a Windows command
- The keyboard is faulty
- Linux does not allow capital letters anywhere
Show answer
Answer: A. Linux treats capital and small letters as different, so LS is not the same command as ls. Capital letters are allowed in Linux file names; they simply count as different characters.
Sign in to keep track of the lessons you finish.