Skip to main content

Built-in Commands

XShell ships with 27 built-in commands that work identically on Windows, macOS, and Linux. They are implemented in xshell/core/builtins.py and are always available — no PATH lookup needed.

Quick reference

CategoryCommands
Navigationcd, pwd, ls, dir
Filescat, touch, mkdir, rm, cp, mv
Outputecho
Terminalclear, cls
Historyhistory
Aliasesalias, unalias
Environmentexport, unset, env
Shell mgmtsource, exit, quit
Discoverywhich, type, help
Themingtheme
Pluginsplugin

Pipeline operators

These are not commands — they're syntax handled by the parser:

OperatorMeaning
|Pipe stdout of left into stdin of right
>Redirect stdout to file (overwrite)
>>Redirect stdout to file (append)
<Redirect stdin from file
&&Run right only if left succeeded (exit 0)
||Run right only if left failed (exit ≠ 0)
;Run both regardless of exit code
&Run in background
# Examples
ls | grep .py > results.txt
make && echo "Build OK" || echo "Build failed"
long_job &

Exit codes

Every command returns an integer exit code. 0 means success, anything else is an error. $? is not yet a shell variable in XShell — the exit code is shown in the status bar of the web terminal.