--- license: gpl tags: - linux - bash pretty_name: bash commands --- # Bash & Linux CLI Dataset ## What This Dataset Is A supervised fine-tuning (SFT) dataset that teaches a language model to **produce correct Bash commands, shell scripts, and Linux CLI operations** — including **Arch Linux** and **Ubuntu/Debian** specifics. The assistant responses are executable commands or scripts that directly accomplish the user's stated task. Explanatory rows describe what a given command does, its key flags, and caveats. ### Sources (provenance-tracked) | Source | Type | Content | |---|---|---| | Embedded corpus (345 entries) | Static | Bash builtins (~55), shell syntax (~40), common Linux commands (~100), scripting patterns (~25), git/docker/systemd, Arch Linux operations (~35), Ubuntu/Debian operations (~35) | | [GNU Bash Reference Manual](https://www.gnu.org/software/bash/manual/bash.html) | Fetched + cached | Official Bash 5.3 reference (builtins, expansions, syntax) | | [Arch Wiki — Bash](https://wiki.archlinux.org/title/Bash) | Fetched + cached | Arch-specific Bash configuration and tips | | [Arch Wiki — Pacman](https://wiki.archlinux.org/title/Pacman) | Fetched + cached | Package management operations | | [Greg's Wiki — BashPitfalls](https://mywiki.wooledge.org/BashPitfalls) | Fetched + cached | Common scripting mistakes and correct alternatives | | [Greg's Wiki — BashFAQ](https://mywiki.wooledge.org/BashFAQ) | Fetched + cached | Frequently asked Bash scripting questions | ### Embedded corpus categories | Category | Count | Description | |---|---|---| | `builtin` | ~55 | All major Bash builtins (`cd`, `echo`, `read`, `export`, `trap`, `set`, `declare`, `getopts`, `history`, etc.) | | `syntax` | ~40 | Quoting, expansion, redirection, pipes, heredocs, process substitution, globbing, parameter expansion, control flow (`if`, `for`, `while`, `case`, `select`) | | `command` | ~100 | `grep`, `sed`, `awk`, `find`, `xargs`, `sort`, `cut`, `tr`, `curl`, `rsync`, `ssh`, `tar`, `chmod`, `git`, `docker`, `systemctl`, `journalctl`, etc. | | `scripting` | ~25 | Strict mode, functions, argument parsing, temp files, lock files, retry patterns, arrays, associative arrays | | `arch` | ~35 | `pacman` operations, AUR (`yay`/`paru`), `makepkg`, `mkinitcpio`, `reflector`, NetworkManager, kernel management | | `ubuntu` | ~35 | `apt`/`dpkg`, Snaps, PPAs, `ufw`, `netplan`, `do-release-upgrade`, `update-alternatives`, Flatpak | ### System prompts - **`SYSTEM_CMD`** — Produce the exact command or script. Use best-practice flags, POSIX-compatible syntax where possible, `&&` for chaining. No commentary unless asked. - **`SYSTEM_EXPLAIN`** — Explain what a command does, its key flags, and caveats, in 1–3 sentences. - **`SYSTEM_SCRIPT`** — Write a complete runnable script with `#!/usr/bin/env bash`, `set -euo pipefail`, and proper error handling. ### Row kinds - **`nl_to_cmd`** — Natural language task → exact command(s). - **`nl_to_cmd_alt`** — Alternative phrasing of the same task → same command. - **`cmd_to_explain`** — Command string → plain-English description. ### Augmentation kinds - **`none`** — Direct from embedded or fetched corpus. - **`distro_slot`** — Generic command reframed with "on Arch Linux" or "on Ubuntu" suffix in the user prompt; same assistant answer. - **`oversample`** — Same assistant answer, user prompt rewritten with a different NL template from a bank of 10 phrasings. ### Scale | Mode | Typical Row Count | |---|---| | Base (no `--augment`) | ~5,100 | | `--augment --target-rows 1000000` | 1,000,000 | --- ## What This Dataset Is NOT - **Not a Bash tutorial or course.** Rows are isolated Q&A pairs, not sequential lessons. There is no curriculum ordering or prerequisite tracking. - **Not shell-agnostic.** Commands target Bash specifically. Zsh, Fish, and POSIX `sh` may diverge on syntax (`[[ ]]`, arrays, `shopt`, process substitution). The dataset does not flag Bash-only constructs. - **Not a complete man-page replacement.** Coverage prioritizes commonly used flags and patterns. Obscure options and corner-case behaviors of each command are not exhaustively documented. - **Not distro-neutral.** Arch and Ubuntu rows use distro-specific package managers (`pacman`, `apt`), init systems, and config paths. They will produce incorrect commands on Fedora, Alpine, or other distributions. - **Not a system administration runbook.** It teaches individual commands and short scripts, not multi-step infrastructure deployment, monitoring strategy, or incident response procedures. - **Not validated against a specific Bash version.** Most syntax targets Bash 4.4+ / 5.x. Some constructs (`${var,,}`, `${var^^}`, `declare -A`, `mapfile`) require Bash 4.0 or later and will fail on older systems. - **Not safety-filtered.** Destructive commands (`rm -rf`, `dd`, `mkfs`) appear as valid answers. No refusal patterns or warnings are included. Apply your own safety layer if needed.