Summary of Operating Systems and System Management
Operating Systems and System Management for Students
Introduction
The command line (also called the terminal or shell) is a text-based interface where you type commands and press Enter to make the computer do tasks. Unlike graphical interfaces where you click icons, the command line accepts precise, typed instructions. This makes many tasks faster, repeatable, and easy to automate with scripts.
Definition: The command line is a text interface for entering commands directly to the computer, enabling precise control and automation.
Why learn the command line?
- Faster for repeated or expert tasks
- Ideal for tools that only provide text interfaces
- Enables scripting to automate workflows
- Essential for many diagnostic and development tools
Basic concepts broken down
Shell, terminal, and commands
- Terminal: the program that opens a window to interact with the shell. Examples: Terminal (macOS/Linux), Command Prompt or PowerShell (Windows).
- Shell: the program that interprets your typed commands (e.g., bash, zsh, cmd, PowerShell).
- Command: a single instruction you type, often with options and arguments.
Definition: A shell is a command interpreter that reads your typed instructions and runs programs accordingly.
Command structure
A typical command follows this pattern:
- command
- options (sometimes called flags), e.g.,
-lor--long - arguments (targets such as filenames or hostnames)
Example: ls -l Documents
Why commands are powerful
- Combine commands using scripts or pipes to create complex workflows
- Run remotely over text-only connections
- Repeatable: save a script and run it again later
Essential commands (quick reference)
Below are common commands for basic navigation and simple network checks. Replace foldername and hostname with the actual names you need.
| Task | Windows (cmd) | Linux / macOS | What it does |
|---|---|---|---|
| List files in current folder | dir | ls | Shows files and subfolders |
| Change directory | cd foldername | cd foldername | Move into a folder |
| Move up one level | cd .. | cd .. | Move to parent folder |
| Show current location | cd (shows current on cmd) | pwd | Print working directory |
| Clear screen | cls | clear | Empty the terminal |
| Check network settings | ipconfig | ifconfig or ip a | Show IP address and related info |
| Test network connection | ping hostname | ping hostname | Send test packets to a host |
| Show network path | tracert hostname | traceroute hostname | Show each hop to destination |
Definition: The ping command sends small packets to a host to check if it responds and to measure round-trip time.
Short example sessions
On Windows:
C:\Users\Lars> dir
C:\Users\Lars> cd Desktop
C:\Users\Lars\Desktop>
On Linux/macOS:
lars@computer:$ ls
Desktop Documents Downloads
lars@computer:$ cd Desktop
lars@computer:~/Desktop$ pwd
/home/lars/Desktop
Checking IP address (examples)
On Windows (cmd):
C:> ipconfig
You'll see entries such as IPv4 Address, Subnet Mask, and Default Gateway.
On Linux/macOS:
lars@computer:~$ ip a
Look for lines with inet showing an address like 192.168.1.100/24.
Definition: An IP address identifies a device on a network; a subnet mask defines the network portion of the address; a default gateway is the router that connects the device to other networks.
Practical tips and real-world applications
- Use the command line to run small tests (ping, traceroute) when troubleshooting connectivity.
- Use
lsordirfrequently to confirm files exist before scripting operations. - Clear the screen (
clear/cls) to reduce clutter during long sessions. - When automating repetitive steps, record the sequence and turn it into a script to run later.
Already have an account? Sign in
Command Line Basics
Klíčové pojmy: The command line is a text-based interface for precise, scriptable control, Terminal is the program; shell interprets typed commands, Command structure: command, options, arguments, List files with dir (Windows) or ls (Linux/macOS), Change directories with cd and check location with pwd, Check IP info with ipconfig (Windows) or ip a / ifconfig (Linux/macOS), Test connectivity using ping and inspect path with tracert/traceroute, CLI enables easy automation and faster workflows for repeated tasks, Use tab completion and test commands on safe data first, Clear the screen with cls (Windows) or clear (Linux/macOS), Combine commands and scripts to create reproducible procedures, Always verify targets before running commands that change or delete files