Linux Command Basics
To interact with Linux through the command line, you need to use a Terminal. This is the window where you type your commands and see the output.
Opening the Terminal
The method to open a terminal varies by distribution, but common shortcuts include:
- Ctrl + Alt + T: Works on most Ubuntu-based systems.
- Super Key (Windows Key): Type "Terminal" and press Enter.
Anatomy of a Command
Most Linux commands follow a standard structure:
Structure: command -options arguments
- Command: The name of the program you want to run (e.g., ls).
- Options/Flags: Modify how the command behaves. They usually start with a hyphen (e.g., -l).
- Arguments: The thing the command acts upon (e.g., a file or directory name).
Example: Using ls -l /home
- ls is the command (list files).
- -l is the option (long format).
- /home is the argument (the directory to list).
Essential First Commands
1. clear
If your terminal screen gets too cluttered, use the clear command to wipe the screen clean.
Bash
clear
2. exit
To close the terminal session properly, you can type exit.
Bash
exit