Skip to content

POSIX Shell and Coreutils

Ved Gupta edited this page Nov 15, 2026 · 6 revisions

POSIX Shell & Coreutils

CodeLab includes a pure-JavaScript POSIX shell interpreter and 73 standard UNIX utilities connected directly to the virtual filesystem and @xterm/xterm multi-session terminal emulator.


Shell Features

  • Pipelines and Redirection: Chain commands together with pipes, redirect standard output and error streams to files, and pass inline input with here-strings and heredocs.
  • Scripting and Control Flow: Run conditional blocks, loops, case statements, shell functions, arithmetic expressions, command substitutions, and brace expansions.
  • Foreground Locking and Background Jobs: Foreground commands lock the terminal prompt until they finish or receive an interrupt signal (Ctrl+C), while background tasks started with an ampersand continue running independently.
  • Multi-Session Tabs & Split Panes: Open multiple independent terminal sessions or side-by-side split panes with command history, reverse history search, tab path completion, clickable file:line:col links, and TrueColor ANSI rendering.
# Start a server in the background and inspect active ports
bun run server.ts &
ports

# Load-test the endpoint and inject 150ms of simulated latency
hey -n 100 -c 10 http://localhost:3000/api
chaos latency 3000 150ms

# Clone a public GitHub repository into the workspace
git clone owner/repo --branch main

# Compile and run a C++20 WebAssembly binary with redirected input
g++ -std=c++20 -O2 main.cpp -o app
./app < input.txt

Built-In Command Reference (73 Commands)

Category Available Commands Purpose
Files & Directories (26) ls, cat, head, tail, wc, cp, mv, rm, mkdir, rmdir, touch, ln, pwd, cd, find, tree, stat, file, du, df, chmod, chown, mktemp, basename, dirname, realpath Navigate directories, manage files and symlinks, inspect permissions, and measure virtual disk usage
Text, JSON & Digests (16) grep, sed, awk, sort, uniq, cut, tr, tee, xargs, diff, jq, xxd, hexdump, base64, md5sum, sha256sum Filter logs, transform streams, query JSON payloads, inspect binary hex dumps, and compute checksums
Networking, Chaos & Data (16) curl, hey, ab, wrk, chaos, sqlite3, redis-cli, nc, ping, dig, nslookup, lsof, netstat, ss, ps, top, kill, jobs, fg, bg Test loopback HTTP servers, benchmark throughput, inject network faults, query SQLite or Redis, and manage processes
Compilers, Git & Terminal (15) node, bun, npm, pnpm, npx, bunx, tsc, g++, clang++, c++, python, python3, pytest, pip, git, serve, tar, gzip, gunzip, clear, reset Run language toolchains, install packages, manage Git branches/stashes/commits, serve web apps, pack archives, and reset terminal screens

Clone this wiki locally