Skip to main content
Nash includes 28 built-in commands that provide essential Unix/Linux command-line functionality entirely within the sandbox. Unlike traditional shells that invoke system binaries, Nash commands operate exclusively through the Virtual Filesystem (VFS) API—no system processes are ever spawned.
All Nash commands are built-in and sandboxed. They never invoke system binaries or access the host filesystem directly (except through explicit --bind mounts).

Quick Navigation

File Operations

cat, cp, mv, rm, touch, file, stat

Directory Operations

ls, cd, pwd, mkdir, tree, find

Text Processing

grep, sed, cut, sort, uniq, wc, head, tail

Data Processing

jq - JSON query and manipulation

Environment

env, export, unset

Utilities

echo, clear, help, history, which, test, true, false

File Operations

Commands for reading, writing, and manipulating files.

cat

Concatenate and print files

cp

Copy files and directories

mv

Move or rename files

rm

Remove files and directories

touch

Create empty files or update timestamps

file

Determine file type from magic bytes

stat

Display file status and metadata

Directory Operations

Commands for navigating and managing directories.

ls

List directory contents

cd

Change current directory

pwd

Print working directory path

mkdir

Create directories

tree

Display directory tree structure

find

Search for files in directory hierarchy

Text Processing

Commands for filtering, transforming, and analyzing text.

grep

Search for patterns in text

sed

Stream editor for text transformation

cut

Extract fields from lines

sort

Sort lines of text

uniq

Filter duplicate lines

wc

Count lines, words, and bytes

head

Output first part of files

tail

Output last part of files

Data Processing

jq

JSON processor — Query and transform JSON data with .key, keys, values, length, type, and .[] operators

Environment

Commands for managing environment variables.

env

Display all environment variables

export

Set environment variables

unset

Remove environment variables

Utilities

General-purpose utility commands.

echo

Print text to stdout

clear

Clear the terminal screen

help

Display command reference

history

Show command history

which

Locate command in Nash builtins

test / [

Evaluate conditional expressions

true

Return success (exit code 0)

false

Return failure (exit code 1)

Complete Command Reference

CommandDescriptionKey Flags
catPrint files or pass-through stdinNone
cdChange directorySpecial: cd - (previous), cd (home)
clearClear terminal screenNone
cpCopy filesNone
cutCut fields from lines-d delimiter, -f fields, -c characters
echoPrint text-n no newline, -e escape sequences
envList environment variablesNone
exportSet environment variableFormat: KEY=VALUE
falseExit with code 1None
fileDetect file typeUses magic bytes + extension heuristic
findSearch for files-name glob, -type f|d, -maxdepth N
grepFilter lines by pattern-v invert, -i ignore case, -n line numbers
headFirst N lines-n N number of lines
helpFull command referenceNone
historyShow command historyOptional: history N to limit
jqProcess JSON.key, keys, values, length, type, .[]
lsList directory-l long format, -a show hidden
mkdirCreate directory-p create parents
mvMove or rename filesNone
pwdPrint working directoryNone
rmRemove files/directories-r recursive, -f force (combine as -rf)
sedStream editors/old/new/[g], Nd delete line N, d delete all
sortSort lines-r reverse, -u unique
statFile statusShows size, type, path
tailLast N lines-n N number of lines
test / [Evaluate expressions-f file, -d dir, -e exists, -z empty, -n not empty, = equals, -eq numeric equal
touchCreate empty fileNone
treeDirectory tree view-L N max depth, -a show hidden
trueExit with code 0None
uniqFilter adjacent duplicates-c count, -d duplicates only, -u unique only
unsetUnset environment variableNone
wcCount lines/words/bytes-l lines, -w words, -c bytes
whichCheck if command is builtinNone

Differences from Standard Unix Commands

Nash commands are compatible subsets of their Unix counterparts. They implement the most commonly used flags and behaviors, but not every advanced feature.

Key Compatibility Notes

Nash’s grep and sed use substring matching, not full regex. Complex patterns like ^start.*end$ or \d+ are not supported.
find -name supports minimal glob: * (any chars) and ? (single char). Character classes like [0-9] are not supported.
jq supports basic operations (.key, keys, values, length, type, .[]) but not advanced queries, filters, or transformations like select(), map(), or recursive descent.
ls -l shows fixed permissions. Nash VFS doesn’t implement full Unix permission modes or ownership.
Commands follow Unix conventions: 0 for success, 1 for errors, 2 for usage errors. Use $? to check exit status.

Command Examples

File Processing Pipeline

# Find all .txt files, search for pattern, count matches
find /home/user -name "*.txt" | while read f; do grep -i "error" "$f"; done | wc -l

Directory Tree Analysis

# Show directory tree with 2 levels, including hidden files
tree -L 2 -a /home/user

JSON Data Extraction

# Extract all keys from JSON file
cat data.json | jq keys

# Get specific field
cat config.json | jq .database.host

Text Transformation

# Sort unique lines from multiple files
cat *.log | sort -u > combined.log

# Replace text in stream
cat input.txt | sed 's/old/new/g' > output.txt

Conditional Execution

# Check if file exists before processing
test -f config.json && echo "Config found" || echo "Missing config"

# Using bracket syntax
[ -d /var/log ] && cd /var/log

Next Steps

View Individual Commands

Detailed documentation for each command

Shell Syntax

Learn about pipes, redirects, and operators

Scripting Guide

Write Nash shell scripts

VFS Overview

Understand the Virtual Filesystem

Build docs developers (and LLMs) love