5 videos 📅 2025-02-18 09:00:00 Africa/Blantyre
4:47:02
2025-02-19 09:20:08
2:39
2025-02-19 21:55:33
1:15:07
2025-02-20 09:31:43
1:28:23
2025-02-20 11:13:37
1:16:38
2025-02-20 13:43:10

Course recordings on DaDesktop for Training platform

Visit NobleProg websites for related course

Visit outline: Ansible for Network Engineers (Course code: ansiblenetwork)

Categories: Ansible

Summary

Overview

This course session provides a foundational introduction to Linux system navigation, file system structure, and core terminal concepts. The instructor guides learners through understanding terminal prompts, user privileges (normal user vs. root), system information commands, and the fundamental Linux principle that “everything is a file.” The session covers file types (regular files, directories, device files, symbolic links), path navigation (absolute vs. relative), and essential commands like pwd, cd, ls -l, du, and df. Practical demonstrations include checking system distribution, kernel version, network configuration, and file permissions, with emphasis on avoiding common pitfalls and understanding the underlying architecture rather than surface-level usage.

Topic (Timeline)

1. Terminal Setup and User Privileges [00:00:00 - 00:04:14]

  • Instructor guides participants to open three terminal windows and adjust display settings (e.g., full screen, zoom via Ctrl+).
  • Explains the terminal prompt: username@hostname:current_directory$ — indicating current user, host, and location.
  • Clarifies that the $ symbol denotes a normal (non-root) user, while # (hash) indicates superuser privileges.
  • Demonstrates switching to root via sudo bash and warns of the risks of root access (“one mistake can wipe your system”).
  • Notes that multiple methods exist to elevate privileges (e.g., sudo su), but sudo bash is used for demonstration.

2. System Information and Environment Discovery [00:04:19 - 00:14:08]

  • Teaches how to identify the Linux distribution using lsb_release -a (Ubuntu in this case).
  • Introduces key system commands:
    • uname -r to check kernel version.
    • uptime to see system runtime.
    • who and who -a to list logged-in users (local and remote).
    • w to display active users and their processes.
    • hostname to retrieve system name.
  • Demonstrates network configuration using ip a (modern) and ifconfig (legacy, distribution-dependent).
  • Emphasizes that command availability and syntax vary across distributions (e.g., Ubuntu vs. older Unix systems).

3. The Linux File System: “Everything is a File” [00:18:26 - 00:28:14]

  • Introduces the core Linux concept: “everything is a file” — including hardware devices, processes, and directories.
  • Demonstrates this using:
    • tty → returns /dev/pts/X, a device file representing the terminal.
    • echo hello > /dev/pts/X → sends text to another terminal (file I/O).
  • Compares file types using ls -l:
    • - = regular file (e.g., text, binary).
    • c = character device (e.g., terminal, serial port).
    • b = block device (e.g., disk drives).
    • d = directory (also a file).
    • l = symbolic link (shortcut).
  • Shows /bin as a symbolic link to /usr/bin for backward compatibility.

4. File System Hierarchy and Navigation [00:28:16 - 00:57:38]

  • Explores root (/) directory structure: /bin, /etc, /home, /proc, /var, /opt, /tmp.
  • Explains /etc as the central configuration directory (e.g., /etc/hosts).
  • Compares Linux hierarchy to Windows (e.g., /etc/hostsC:\Windows\System32\drivers\etc\hosts).
  • Introduces navigation commands:
    • pwd → print working directory.
    • cd / → go to root.
    • cd (no args) → go to home directory.
    • ~ (tilde) → shorthand for home directory.
    • cd .. → move up one level.
    • cd - → toggle between last two directories.
  • Teaches absolute paths (start with /) vs. relative paths (based on current location).
  • Demonstrates tab completion to reduce typing and avoid errors.

5. File Operations, Permissions, and Disk Usage [00:57:40 - 01:14:35]

  • Demonstrates file creation with touch and copying with cp (source and destination required; no defaults).
  • Explains . (current directory) and .. (parent directory) as path components.
  • Introduces du -sh to calculate directory size (e.g., du -sh /home/student).
  • Contrasts ls -l (shows directory size as 4K) with du (shows actual content size).
  • Uses df -h to display disk usage across mounted filesystems in human-readable format.
  • Demonstrates creating a test file with dd (e.g., dd if=/dev/zero of=bigfile bs=500 count=50 → 25KB file).
  • Warns about the power and danger of dd — can overwrite critical data if misused.

Appendix

Key Principles

  • Everything is a file: Devices, directories, and processes are represented as files in the filesystem.
  • No file extensions: File type is determined by content, not extension (e.g., .txt is a convention, not a system rule).
  • Use ls -l to identify file types: First character indicates type (-, d, l, c, b).
  • Absolute vs. Relative Paths: Absolute starts with /; relative is based on current location.
  • Tilde (~) = home directory; . = current directory; .. = parent directory; cd - = toggle last directory.

Tools Used

  • lsb_release -a — distribution info
  • uname -r — kernel version
  • who, w, uptime — user and system status
  • ip a, ifconfig — network config
  • tty — current terminal device
  • cd, pwd, ls, cp, touch — navigation and file ops
  • du -sh — directory size
  • df -h — disk usage
  • dd — low-level file creation (advanced)

Common Pitfalls

  • Confusing ls -l directory size (always 4K) with actual content size → use du.
  • Assuming cp defaults to current directory — must explicitly specify destination.
  • Using ifconfig on modern systems where it’s deprecated; prefer ip.
  • Running sudo bash or dd without understanding consequences.
  • Relying on file extensions to determine type — use file command (implied) or ls -l instead.

Practice Suggestions

  • Open multiple terminals and send messages between them using echo "text" > /dev/pts/X.
  • Navigate the full filesystem: start at root, move to /etc, /home, /bin, and back.
  • Use ls -l /dev to identify device files and classify them (c vs b).
  • Create a test file with dd and measure its size with du -h.
  • Practice path navigation: from /home/user to /bin using both absolute and relative paths.