System Command Reference Index & Syntax Guide
Usage: help
Usage: ls
Usage: cd [directory]
Usage: pwd
Usage: mkdir <directory_name>
Usage: touch <file_name>
Usage: cat [file]
Usage: nano <file>
Usage: mv <src> <dst>
Usage: cp <src> <dst>
Usage: rm [-rf] <target>
Usage: grep <pattern> [file]
Usage: sed <expression> [file]
Usage: head [-n lines] [file]
Usage: tail [-n lines] [file]
Usage: wc [-l | -w | -c] [file]
Usage: find [path] [-name pattern] [-type filter]
Usage: export [key=value]
Usage: whoami
Usage: date
Usage: ping <host>
Usage: ip [a | addr | link | show]
Usage: ifconfig
Usage: top
Usage: chmod [+x | -x] <file>
Usage: sudo <command>
Usage: alias [shortcut='command']
Usage: man <command>
Usage: clear
Usage: base64 [-d] <file>
Usage: sha256sum [file]
Usage: ln [-s] <target> <link_name>
Usage: neofetch
Usage: history
Usage: sh
Usage: exit
Usage: fash [file.fash] or ./file.fash
Usage: fpt list | install [package] | uninstall [package] | update | upgrade | upload [file.fash] | rate [package] [1-5] | report [package] [reason] | help
Usage: jobs
Usage: fg [job_id]
Usage: bg [job_id]
Usage: curl [url]
Usage: wget [url]
Official Developer Reference, Sandboxed APIs & Template Packs
Fash (Flat Bash) is the official scripting ecosystem in PurOS v3.0. Fash scripts allow automation, simple calculation routines, interactive terminal layouts, and dynamic visualizations inside the sandboxed POSIX console. You can write shebang scripts directly inside the nano editor and execute them using ./yourscript.fash.
This engine processes standard console commands line-by-line exactly as if you were typing them sequentially in the prompt. Useful for setting up directories, making system backups, or calling series of built-in commands.
#!/bin/fash echo "Initializing environment setup..." mkdir -p /ROOT/projects cd /ROOT/projects touch README.md echo "Setup Complete!" > README.md ls -l
This engine executes Javascript loops, calculations, condition blocks, and logic statements directly within a hardened virtual runtime window. It isolates global variables while offering key shell control handles.
#!/bin/js
print("Executing JavaScript sandboxed code block.");
let total = 0;
for (let i = 1; i <= 10; i++) {
total += i;
}
print("Sum of numbers from 1 to 10 is: " + total);
When running under #!/bin/js shebang, the following system API hooks are exposed in the execution sandbox context:
| API Hook | Type | Description |
|---|---|---|
print(text) |
Function | Outputs a single text line to the console interface window. |
args |
Array | Array of parameters passed during shell execution (e.g. running ./calc 5 + 3 registers arguments ["5", "+", "3"]). |
pwd() |
Function | Returns the current absolute working directory string (e.g. "/ROOT/bin"). |
whoami() |
Function | Returns the active system user identity name. |
ls() |
Function | Returns the listing string of the active folder content nodes. |
cd(path) |
Function | Changes the shell location state. |
exec(cmd) |
Function | Executes any shell subcommand as a sub-process and returns a structured object: { success: boolean, output: string }. |
require(path) |
Function | CommonJS style dynamic module importer. Allows code reuse by reading, caching, and evaluating another JS script file from the virtual file system! |
cat(filePath) |
Function | Direct virtual file content reader. Returns `null` if the file doesn't exist. |
write(filePath, content) |
Function | Direct virtual file content writer. Overwrites target file or creates it automatically. |
db |
Object | Persistent sandboxed key-value store. Methods: db.set(k, v), db.get(k), db.delete(k). |
setProcess(meta) |
Function | Registers active timing loops so the user can abort them cleanly using the Ctrl+C keystroke sequence. Usage: setProcess({ type: "name", interval: timerId }). |
Using Fash SDK v3.2, you can build layered architectures by structuring code into standalone shared modules (e.g. databases, utilities, parsers) and importing them inside a controller script using require(), while executing sub-processes via exec().
#!/bin/js
// CommonJS exports supported!
module.exports = {
add: (a, b) => a + b,
square: (x) => x * x,
info: "Secure Math Core Utility Module"
};
#!/bin/js
// Require mathematical module dynamically!
const math = require("/ROOT/bin/mathLib.js");
print("Loading helper: " + math.info);
print("12 + 15 = " + math.add(12, 15));
print("Square of 9 = " + math.square(9));
Prints simulated RAM and CPU stats, increments a persistent boot metric count in the sandboxed KV database, and logs the execution state directly to a log file.
#!/bin/js
let runs = db.get("boot_count") || 0;
runs++;
db.set("boot_count", runs);
print("--- System Health Logger v3.2 ---");
print("Number of runs registered: " + runs);
print("Writing health logs to /ROOT/system_health.log...");
const cpu = Math.floor(Math.random() * 25) + 5;
const logLine = "[" + new Date().toLocaleTimeString() + "] Health Check - CPU: " + cpu + "%\n";
let existing = cat("/ROOT/system_health.log") || "";
write("/ROOT/system_health.log", existing + logLine);
print("Done! Last Log: " + logLine.trim());
This controller program invokes `neofetch` and standard folders subcommands natively, captures their outputs, and prints a formatted diagnostic summary.
#!/bin/js
print("Initializing Pipeline Controller Diagnostic...");
print("Running sub-process neofetch...");
const sysInfo = exec("neofetch");
if (sysInfo.success) {
print("--- Retrieved Sub-Process Output ---");
print(sysInfo.output);
print("-------------------------------------");
} else {
print("Failed to run neofetch.");
}