Shell commands
Every command of the DragonOS shell, from ls and grep to ip, raid and the hardware commands.
Type help in the shell for this list and man COMMAND for the details of one command.
#Files
| Command |
Does |
ls [-l] [-a] [-1] [path...] |
List a directory. -l shows modes, sizes and dates. |
pwd, cd DIR |
Show or change the working directory. |
cat [-n] [file...] |
Print files; -n numbers the lines. |
mkdir [-p] dir..., rmdir dir... |
Make or remove directories. |
rm [-r] [-f] file... |
Remove files; -r removes directories too. |
cp [-r] source... dest, mv source... dest |
Copy, move or rename. |
touch file... |
Create empty files or update their time. |
find [path] [-name pattern] [-type f|d] |
Search a directory tree. |
tree [path], stat file... |
Show a tree, or a file's type, size and time. |
du [-s] [-h] [path...], df [-h], mount |
Disk use, free space and mounted file systems. |
chmod MODE file... |
Change permissions; +x makes a file runnable by name. |
basename path, dirname path |
Parts of a path. |
edit file (nano) |
The text editor. |
less file (more) |
Page through a file. |
#Text
| Command |
Does |
echo [-n] [-e] [text...] |
Print text; -e understands escapes. |
printf FORMAT [arguments...] |
Print by a format: %s %d %c %x %o %%. |
head [-n N], tail [-n N] |
First or last lines. |
wc [-l] [-w] [-c] |
Count lines, words, characters. |
grep [-i] [-v] [-n] [-c] pattern [file...] |
Lines matching a regular expression. |
sort [-r] [-n] [-u], uniq [-c], rev |
Sort, drop repeats, reverse lines. |
tee [-a] file |
Copy input to a file and to the output. |
seq [FIRST [STEP]] LAST |
Print numbers. |
test EXPRESSION or [ EXPRESSION ] |
Check files, strings and numbers. |
true, false, : |
Do nothing, successfully or not. |
tput clear|cup ROW COL|el|ed|civis|cnorm|rev|sgr0|cols|lines |
Terminal control. |
#Processes and system
| Command |
Does |
ps [aux], top |
List processes. |
kill [-9|-15|-2] pid..., killall [-9] name |
Signal processes. |
sleep seconds |
Wait; decimals work (sleep 0.5). |
uptime, date, whoami, who |
Time, world date and users. |
hostname [name], uname [-a] |
Computer name and system. |
free [-h], dmesg, env (printenv), which |
Memory, kernel messages, environment. |
sysinfo (neofetch) |
The system at a glance, with the DragonOS logo. |
clear |
Clear the terminal. |
reboot, shutdown (poweroff, halt) |
Restart or power off. |
sh script (dsh), sh -c 'commands' |
Run a script. |
Shell built-ins: cd, export, alias, history, jobs, fg, source, exit.
#Hardware
| Command |
Does |
lsbus |
The Redbus devices: address and type. |
lscpu, sensors |
The processors, their state, usage, temperature and cooling. |
io address [color on|off] |
Read or switch an I/O expander's outputs (colour 0-15). |
rs address [side [0-15]], rs address pulse side ticks |
Read or drive a Redstone Adapter; alone, show every side. |
fdformat |
Format the floppy in the drive. Every file on it is lost. |
basic [program] |
DragonBASIC, optionally running a program. |
#Storage and crafting
| Command |
Does |
storage |
Open the Storage app. |
storage list |
Every volume, its use and state. |
storage import [port [volume|auto|off]] |
Route an import port into a volume. |
stock [text] |
Items on the drives, optionally only names containing the text. |
withdraw item [count] |
Send items out of an export port. |
craft recipe [times] |
Queue an Autocraft job. |
autocraft |
Open the Autocraft app. |
raid ..., share ..., smbmount ..., smbumount NAME |
See RAID and network storage. |
#Network
All network commands take -I ethN to choose a card. Without it, the card is chosen by the routing
table, as on Linux.
| Command |
Does |
ip addr (ip a) |
The cards' addresses. |
ip addr add 192.168.1.20/24 dev eth0 |
Set an address by hand. |
ip addr del ADDRESS dev eth0, ip addr flush dev eth0 |
Remove addresses. |
ip route (ip r) |
The routing table. |
ip route add default via 192.168.1.1 |
Set the default gateway. |
ip route add 10.2.0.0/16 via 192.168.1.5, ip route del default |
Static routes. |
ip route get ADDRESS |
Which card and gateway a packet takes. |
ip neigh |
The ARP cache. |
ip link |
The cards and their links. |
dhclient [-r] [-v] [ethN...] |
Get an address by DHCP; -r releases it. |
ifconfig |
Addresses, netmask, broadcast, MAC, link and traffic. |
ping [-c count] [-t ttl] address |
ICMP echo, one a second. |
traceroute [-m hops] address |
The routers on the way. |
netsend address text..., netrecv [-a] |
Send a text message; read the oldest (or all). |
nethosts |
The computers on the card's network and VLAN. |
cat /proc/net |
Every card, with prefix, DHCP and gateway. |
An address without /prefix keeps the card's prefix (/24 at first).