{"slug": "day-02-the-terminal-shells-file-systems", "title": "Day 02: The Terminal, Shells & File Systems", "summary": "A developer explains the fundamental differences between terminal emulators and shell interpreters, covering Windows Terminal, PowerShell, and Command Prompt. The post details file system path tracking, hidden dotfiles, and essential CLI utilities like pwd, ls, and cd.", "body_md": "Understand the interface boundary between Terminal Emulators and Shell Interpreters (including Windows Terminal vs. PowerShell vs. CMD).\n\nMaster File System path tracking, hidden dotfiles, and essential CLI utilities.\n\nMap system execution paths via global and local environment configurations.\n\n**Terminal:** The visual GUI wrapper. A window application that captures keyboard strokes, handles GPU text rendering, and manages tabs/panes.\n\n**Shell:** The command interpreter engine running *inside* the terminal. It evaluates text strings, processes scripts, issues system calls (`syscalls`\n\n), and interacts with the OS Kernel.\n\n```\n┌────────────────────────────────────────────────────────┐\n│ WINDOWS TERMINAL GUI (The Visual Interface Window)     │\n│  │                                                     │\n│  ├───► Tab 1: [ PowerShell Core Engine (Modern) ]       │\n│  ├───► Tab 2: [ Command Prompt Engine  (Legacy) ]       │\n│  └───► Tab 3: [ WSL Ubuntu Linux Bash  (Core) ]         │\n└───────────────────────────┬────────────────────────────┘\n                            │ Raw Text & Input Streams\n                            ▼\n┌────────────────────────────────────────────────────────┐\n│ SHELL INTERPRETER (e.g., PowerShell / CMD)             │\n│  └───► Parses input string commands into system tasks  │\n└───────────────────────────┬────────────────────────────┘\n                            │ System Call (Syscall)\n                            ▼\n┌────────────────────────────────────────────────────────┐\n│ OPERATING SYSTEM KERNEL                                │\n│  └───► Interacts directly with underlying hardware     │\n└────────────────────────────────────────────────────────┘\n```\n\nWhile both are Windows shells hosted inside Windows Terminal, they belong to entirely different computing eras:\n\n**Command Prompt ( cmd.exe):** A legacy text shell maintained purely for backwards compatibility with 1980s MS-DOS. It pipelines data as\n\n**PowerShell ( pwsh.exe):** A modern, cross-platform scripting engine. It pipelines data as\n\n```\n[ CMD APPROACH (Text Parsing Stream) ]\n`dir` ──► Outputs text characters ──► Requires complex string filters to read metadata.\n\n[ POWERSHELL APPROACH (Object Oriented) ]\n`Get-ChildItem` ──► Outputs File Objects ──► Programmatically query: file.Size, file.Extension\n```\n\n**Root ( / or C:\\):** The absolute origin of the system storage hierarchy.\n\n**Absolute Path:** Complete address starting directly from the system root.\n\n`C:\\var\\www\\rextora\\src\\server.js`\n\n**Relative Path:** Conditional paths computed dynamically based on your current working location.\n\n`../config/.env`\n\n(moves up one directory level, then steps into the config folder).**Hidden Files (Dotfiles):** Administrative configuration layers starting with a period (`.`\n\n). The OS restricts them from standard folder views by default to safeguard configuration states.\n\n`.env`\n\n, `.gitignore`\n\n, `.profile`\n\n.\n\n```\n               [ C:\\ ]  (SYSTEM ROOT)\n                  │\n         ┌────────┴────────┐\n       /bin              /var\n                           │\n                         /www\n                           │\n                       /rextora  ◄── [ Absolute Start ]\n                           │\n                  ┌────────┴────────┐\n                /src             /config\n                  │                 │\n             server.js            .env  ◄── [ Hidden File ]\n                  ▲                 ▲\n                  │                 │\n                  └────( ../ )──────┘   ◄── [ Relative Step ]\n```\n\nDirect textual manipulation of storage resources and active processes, completely bypassing graphical interfaces. These are the core commands a developer must know:\n\n`pwd`\n\n──► **Prints your current location:** Displays the exact absolute path of the folder you are currently working inside.\n\n`ls`\n\n(or `dir`\n\non Windows) ──► **Lists directory contents:** Scans and shows all files and folders contained within your current path.\n\n`cd`\n\n──► **Changes your directory:** Moves your terminal's active focus forward into a target folder or backward (`cd ..`\n\n) to a parent folder.\n\n`mkdir`\n\n──► **Creates a new folder:** Instantly allocates a brand-new, empty directory sector on your storage drive.\n\n`touch`\n\n(or `New-Item`\n\non Windows) ──► **Creates a blank file:** Drops a new empty file pointer (like `app.js`\n\nor `.env`\n\n) directly into your current directory.\n\n`cat`\n\n──► **Views file contents:** Prints the raw text inside a file directly onto your screen without launching an external text editor.\n\n`rm`\n\n──► **Permanently deletes files/folders:** Erases target files instantly, bypassing the recycle bin completely (`rm -rf`\n\nforcefully purges entire folder branches).\n\n```\n       [ Command Input ] ──► `mkdir -p src/api`\n               │\n               ▼\n┌───────────────────────────────┐\n│ DISK ALLOCATION               │\n│   Storage Sector Partitioned  │\n│   └── src/                    │\n│       └── api/                │\n└──────────────┬────────────────┘\n               │\n               ▼\n       [ Next Command ]  ──► `touch src/api/index.js` (Creates empty file pointer)\n```\n\n`$PATH`\n\nVariable\n**Environment Variables:** Global key-value pairs allocated inside RAM, enabling running applications to fetch setup states (like database credentials) cleanly outside source code files.\n\n*Real .env Example:*\n\nIni, TOML\n\n```\nPORT=5000\nDB_URL=\"mongodb://localhost:27017/rextora\"\nJWT_SECRET=\"supersecretkey123\"\n```\n\n**The $PATH Variable:** A specialized system environment variable containing a colon-delimited string list of absolute directories where executable tool binaries live.\n\n*Real $PATH Example (Linux/Mac):*\n\nBash\n\n```\n/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin\n```\n\n*The Breakdown:*\n\n`/usr/local/bin`\n\n: Where user-installed third-party tools live.`/usr/bin`\n\n: Standard system executables managed by the OS.`/bin`\n\n: Essential basic system utilities (like `ls`\n\n, `cp`\n\n, `mkdir`\n\n).`/opt/homebrew/bin`\n\n: Mac Homebrew installation binaries.\n\n```\n┌─────────────────────────────────────────────────────────────────────────────┐\n│ RAM ENVIRONMENT MEMORY BUFFER                                               │\n│                                                                             │\n│  ├── PORT=5000                                                              │\n│  ├── DB_URL=\"mongodb://localhost...\"                                        │\n│  └── $PATH / Path Array:                                                    │\n│      [ /usr/local/bin ] ──► [ /usr/bin ] ──► [ /bin ] ──► [ /opt/homebrew ] │\n└─────────────────────────────────────────────────────────────────────────────┘\n```\n\n`node`\n\n, the shell loops through every folder in your `$PATH`\n\narray sequentially looking for `node.exe`\n\n. If the tool path is absent from the list, the shell drops a `\"command not found\"`\n\n/ `\"not recognized as an internal or external command\"`\n\nexception.\n\n```\n  [ USER TYPES COMMAND ] ──► e.g., \"node app.js\"\n            │\n            ▼\n  [ SHELL INTERPOLATION ] ──► Shell parses input text.\n            │\n            ▼\n  [ PATH DIRECTORY SCAN ] ──► Scans folders listed inside global Path:\n            │\n            ├───► Check 1: /usr/local/bin  ──► [ Not Found ]\n            ├───► Check 2: /usr/bin        ──► [ FOUND EXECUTABLE! ]\n            └───► Skip remaining paths.\n            │\n            ▼\n  [ KERNEL EXECUTION ] ──► Shell hands the executable binary to the OS Kernel.\n```\n\n✨ **Decoupled Runtimes:** Terminal applications manage user interface styling; shell platforms evaluate code execution and issue system hooks.\n\n✨ **Modern Shell Rule:** CMD is legacy infrastructure. Rely strictly on PowerShell Core or Linux Bash for modern engineering workflows.\n\n✨ **Binary Mapping:** Applications are unreachable by standard command calls unless their parent directory is securely mapped inside the system's global `$PATH`\n\n.\n\n**Terminal vs Shell:** Visual wrapper environment (Windows Terminal) vs. logic parser interfaces (PowerShell, CMD, Bash).\n\n**CMD vs. PowerShell:** Legacy text-based stream pipeline vs. modern object-oriented pipeline.\n\n**Paths:** Absolute starts tracking directly from root (`/`\n\nor `C:\\`\n\n); relative calculates offsets from where your terminal window is working right now.\n\n**Bin Lookups:** The shell queries the systematic `$PATH`\n\nvariable map to safely trace and wake up program files stored across the hard drive.\n\n**Terminal vs. Shell:** *\"The terminal is the monitor screen frame; the shell is the text engine processing logic inside that frame.\"*\n\n**CMD vs. PowerShell:** *\"CMD is a typewriter pushing raw text lines; PowerShell is a conveyor belt transporting rich data objects.\"*\n\n**The $PATH Variable:**", "url": "https://wpnews.pro/news/day-02-the-terminal-shells-file-systems", "canonical_source": "https://dev.to/rextora-labs/the-terminal-shells-file-systems-1lhc", "published_at": "2026-07-08 12:45:13+00:00", "updated_at": "2026-07-08 12:58:59.252723+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Windows Terminal", "PowerShell", "Command Prompt", "CMD", "MS-DOS", "WSL", "Ubuntu", "Bash"], "alternates": {"html": "https://wpnews.pro/news/day-02-the-terminal-shells-file-systems", "markdown": "https://wpnews.pro/news/day-02-the-terminal-shells-file-systems.md", "text": "https://wpnews.pro/news/day-02-the-terminal-shells-file-systems.txt", "jsonld": "https://wpnews.pro/news/day-02-the-terminal-shells-file-systems.jsonld"}}