User Interface
Graphical User Interface
Graphical User Interface (GUI) commonly referred as the User Interface (UI).
Command Line Interface
- Command Line Interface (CLI) facilitates the users to perform powerful operations on a computer with simple commands.
Command is a text instruction to a computer program to perform a specific task.
What is Shell?
Shell is the software that interprets and executes the various commands that we provide.
Terminal is a text input/output environment.
Different Shells
Bourne Shell (sh)
Bourne-Again Shell (bash)
C Shell (csh)
Korn Shell (ksh)
Z Shell (zsh)
Opening Terminal
Bash is one of the most commonly used shell in Linux distributions.
Open the Dash (Super Key) or Applications and type terminal.
Shortcut: Ctrl + Alt + T
Opening Terminal (in MAC)
Open Launchpad and search for terminal.
Press command(⌘) + space, type "terminal".
For Windows Operating System
For windows install WSL2 (Windows Subsystem for Linux).
Opening WSL2 Ubuntu Terminal
Click Start and search for "Ubuntu".
Using Cloud
Alternatively you can use Google Cloud Shell.
Bash
Commands
Listing Files & Directories
Using Additional Options
- -l -h option provides details in human readable format.
- Some options require values arguments/values to be passed.
- --block-size option rounds the file size to nearest values.
- Inputs : KB , MB
Get Options for Commands
This Command will be helpful when you don’t know about its parameters and return type etc.
Clear the Screen
- clearcommand clears the terminal.
- Shortcut: Ctrl+L.
Get User Manual for Commands
- mandisplays the user manual of a command .
- Here we pass the command as an argument.
Syntax:
Example:
- Type q to exit the manual
Get System Date & Time
Get Current User
Previous Commands
- Shell keeps track of the commands you have typed in.
- Use up ( ⬆) and down ( ⬇) arrows to access the commands.
History
- historydisplay the history of the commands you have typed in so far.
- By default, It shows the last 500 recent commands.
Bash History
Bash maintains the history to . bash_history file.
exit
Summary
Command | Description |
---|---|
ls | List files & directories |
date | Displays the system date and time |
whoami | Displays current logged in user |
--help | Displays list of options for a given command |
man | Displays user manual for a given command |
clear | Clears the shell |
history | It will show you the last five hundred commands you have entered. |
exit | Ends the shell |