Skip to content
Download for Mac

Unix Commands

Type @unix-commands in the composer to give the agent read-only access to your filesystem and system state. The agent can search files, browse directories, read contents, process text, and inspect system resources — but cannot modify, create, or delete anything.

The model doesn’t construct raw shell commands. Instead, QARK exposes a single tool with a typed JSON schema. The model selects a command name and fills in structured parameters (path, pattern, flags as booleans), and QARK’s backend maps those parameters to safe CLI arguments through per-command typed structs. This prevents injection — the model never writes a raw command string.

For example, when the model wants to search for a pattern, it sends:

{
"command": "grep",
"pattern": "TODO",
"path": "/Users/me/project/src",
"recursive": true,
"case_insensitive": true
}

QARK’s backend deserializes this into a typed GrepArgs struct, converts it to grep -r -i -- TODO /Users/me/project/src, and executes it in a controlled subprocess. Shell metacharacters (|, ;, &&, `, $(, >, <) are rejected in all string arguments.

CommandWhat It Does
lsList directory contents — supports hidden files, long format, recursive, sort by time or size
catDisplay file contents — accepts multiple files, optional line numbering
headShow the first N lines of a file (default 10)
tailShow the last N lines of a file (default 10)
grepSearch file contents by regex pattern — recursive, case-insensitive, include/exclude globs, max count
findLocate files by name pattern, type (file/directory/symlink), size, modification time, with depth limits
wcCount lines, words, or characters in a file
CommandWhat It Does
sedStream editor — apply substitution expressions to file content (output only, no in-place editing)
awkPattern scanning — run awk programs against files for field extraction and transformation
sortSort file lines — numeric, reverse, by field, with deduplication
uniqFilter or count duplicate lines — show counts, duplicates only, or unique only
cutExtract fields or character ranges from file lines
CommandWhat It Does
psList running processes — sort by CPU or memory, filter by user
uptimeShow system uptime and load averages
dfReport filesystem disk space — human-readable, inode mode
duEstimate directory sizes — summary, max depth, human-readable
meminfoRAM and swap usage — runs vm_stat on macOS, free on Linux
sysctlHardware specs — CPU model, core count, total RAM (macOS: sysctl, Linux: /proc)

Output is truncated at 100KB to prevent context overflow. Commands time out after 30 seconds.

Commands resolve the working directory in this order:

  1. Per-call override — the model can specify a working_directory in the tool call
  2. Per-conversation override — set via unix_working_dir in the conversation’s config overrides
  3. Global setting — configured in Settings → General → Default Working Directory
  4. Fallback$HOME

Tilde expansion (~/) works in all path arguments — QARK expands it before execution since commands run without a shell.

When @unix-commands is active, QARK elevates the tool turn limit to 20 for that response. This allows the agent to chain multiple commands — locate files, search their contents, then read the matches — without hitting the default 10-turn cap.

Unix command results showing grep output with highlighted matches

Ask the agent to map out a project’s structure, find all files matching a pattern, or search for specific function definitions across hundreds of files — without leaving the conversation.

Point the agent at a log directory and let it search for error patterns, count occurrences, or filter by timestamp ranges. Chain grepsortuniq to aggregate results.

Check running processes, inspect disk usage, query memory and CPU specs, or verify that a service is running — all from the same conversation where you’re discussing the issue.

Extract fields from CSV files with cut, transform output with awk, filter duplicates with sort and uniq, or apply substitutions with sed — all read-only, all sandboxed.