💻

Linux Network & System Commands

Jun 11, 2025

Overview

This lecture covers essential Linux network and system management commands, focusing on configuration, troubleshooting, file operations, resource monitoring, disk usage, and text editing.

Network Configuration & Troubleshooting

  • Use the ip command to enable, disable, or configure network interfaces.
  • ip address displays current IP configurations for all interfaces.
  • The loopback interface uses IP 127.0.0.1, while physical adapters display their own IPs, subnet masks, and MAC info.
  • Use ip route to view routing tables.
  • The ping command tests connectivity to specific IPs, continuously sending packets until interrupted (Ctrl+C).
  • Ping output includes sequence number, time to live (TTL), and roundtrip time.
  • Use curl to fetch raw HTML or data from web servers at the command line.
  • The dig command queries DNS servers for information, returning IP addresses for domain names.
  • traceroute (Linux/Mac: traceroute, Windows: tracert) shows the network path and routers (hops) between your device and a destination.

Working with Files & Documentation

  • Use the man command to access built-in Linux documentation for any command.
  • The cat command displays file contents or concatenates multiple files into one using redirection (>).

System & Resource Monitoring

  • top provides a real-time view of processes, resource usage, and system load over 1, 5, and 15 minutes.
  • The ps command lists running processes; ps -e shows all processes, and you can combine it with grep to filter for specific ones.
  • Use more to page through long command outputs.

Disk Space Management

  • df shows disk space usage for all file systems; use df -h for human-readable output (e.g., GB, MB).
  • du -h recursively displays disk usage per directory to help locate large files or folders consuming space.

Editing Files

  • Use text editors like nano for modifying configuration or log files within the terminal.
  • nano enables navigation, editing, and saving changes using keyboard shortcuts.

Key Terms & Definitions

  • IP Command — Tool for managing network interfaces and configurations.
  • Loopback Address — Special IP address (127.0.0.1) used for internal network testing.
  • Ping — Network tool checking connectivity to a remote device via ICMP packets.
  • curl — Command-line tool for transferring data to/from servers.
  • dig — DNS lookup utility for querying domain information.
  • traceroute — Maps network path and hops to a destination.
  • man — Linux manual page viewer.
  • cat — Displays or concatenates file content.
  • top — Real-time system resource and process monitor.
  • ps — Lists running processes.
  • df — Shows disk free space.
  • du — Shows disk usage by folder/file.
  • nano — Full-screen, terminal-based text editor.

Action Items / Next Steps

  • Practice using commands: ip, ping, curl, dig, traceroute, man, cat, top, ps, df, du, and nano.
  • Explore man pages for these utilities to learn additional options and usage details.