Linux CLI HowTo 1 ๐ง How Tos for Beginners
1 – Linux Command Line How-Tos for Beginners
โ How to Open Different Terminal Emulators
Why: Learn how to access command line in different desktop environments.
Steps:
- KDE (Konsole):
- Press
Alt+F2then typekonsole - Or click Applications โ System โ Konsole
- GNOME (Terminal):
- Press
Ctrl+Alt+T - Or click Activities โ Search “Terminal”
- XFCE:
- Press
Ctrl+Alt+Tor Applications โ Accessories โ Terminal
๐ How to Check Current Date and Calendar
Why: Learn basic date/time commands.
Steps:
- Type these commands:
date
cal
- You’ll see current date and calendar for current month
๐ How to Use Command History
Why: Navigate through previous commands easily.
Steps:
- Press
โ(up arrow) to go through previous commands - Press
โ(down arrow) to go back down - Press
Ctrl+Rto search through history
๐ How to Learn What Commands Are Available
Why: Discover what commands you can use.
Steps:
- List all available commands:
ls /bin
- Or see all commands in PATH:
compgen -c | head -20
๐ How to Get Help on Commands
Why: Learn how to understand what commands do.
Steps:
- Use
mancommand:
man date
- Or use
--help:
date --help
๐งช How to Exit the Terminal
Why: Learn how to close your session properly.
Steps:
- Type:
exit
- Or press
Ctrl+D
๐ How to See Different Calendar Formats
Why: Explore various calendar views.
Steps:
- Current month:
cal
- Specific month/year:
cal 12 2024
- Year view:
cal 2026
๐ How to Check System Time and Date
Why: Understand how your system keeps track of time.
Steps:
- Show current date/time:
date
- Show in different formats:
date +"%A, %B %d, %Y"
โฌ ๏ธ โก๏ธ How to Move Cursor in Command Line
Why: Navigate quickly within your commands.
Steps:
- Use left/right arrows to move cursor
Ctrl+A– go to beginning of lineCtrl+E– go to end of lineCtrl+U– cut from cursor to beginning of line
๐งช Exercise 1: Date Command Practice for Chapter 1
- Open terminal
- Type:
date
- Type:
date +"%Y-%m-%d"
- Type:
date +"%H:%M:%S"
๐ Exercise 2: Calendar Exploration for Chapter 1
- Type:
cal
- Type:
cal 1 2024
- Type:
cal 12 2023
๐ Exercise 3: History Navigation for Chapter 1
- Type some commands like
date,cal,ls - Use up arrow to recall previous commands
- Edit one of the recalled commands and press Enter
๐ Key Files and Directories to Remember for Chapter 1
| Command | What it does |
|---|---|
date | Shows current date/time |
cal | Shows calendar |
exit | Closes terminal session |
man | Shows manual pages |
ls /bin | Lists all commands |
๐ฏ Quick Reference Commands for Chapter 1
โ– Previous commandโ– Next commandCtrl+R– Search historyCtrl+C– Cancel current commandCtrl+L– Clear screenCtrl+D– Exit terminal