UNIX to Plan 9 translation
What follows is a table of transliterations from UNIX to Plan 9 commands or syntactical elements of Bourne-like shells to the Plan 9 rc shell.
Plan 9 commands are typically not direct ports of UNIX commands and as such should not be expected to operate the same.
When in doubt, UNIX refers to your average GNU/Linux distribution and a Bourne-like shell, most likely bash(1). Similarly, when in doubt, Plan 9 refers to the 9front fork of Plan 9.
Commands
Tools
UNIX | Plan 9 |
---|---|
sh |
rc or ape/psh |
apropros or man -k |
lookman |
at specific-time |
while (! ~ `{date} specific-time){ commands } |
cc |
ape/cc or the native [2c](http://man.cat-v.org/9front/1/2c) suite |
ld |
The native [2l](http://man.cat-v.org/9front/1/2l) suite |
make |
mk |
less and more |
p |
which |
whatis |
doas |
auth/as |
yes |
while(){ echo y } |
shutdown |
fshalt |
reboot |
fshalt -r or reboot |
startx |
rio |
top |
stats and ps |
tree |
du $* | awk '{print $2}' | sort | sed 's/[^\/]+\// /g' |
ufs{dump|restore} |
yesterday , history , or 9fs dump |
mail |
upas/fs , mail , and faces |
tcpdump |
snoopy |
ping |
ip/ping |
apt-get dist-upgrade , rpm -Ua , yum -c update |
sysupdate && cd /sys/src && mk clean && mk libs && mk install |
apt , yum , pacman |
See ExternalSoftware |
ftp |
ftpfs |
ftpd |
aux/listen ftp |
httpd |
rc-httpd/rc-httpd or ip/httpd/httpd |
head |
sed 11q |
groff |
troff |
groff -l |
troff | lp |
grops |
dpost |
getopt |
aux/getflags |
vim , emacs , nano , etc. |
sam , acme , and ed |
df |
For hjfs: echo df >> /srv/hjfs.cmd |
For cwfs: con -Cl /srv/cwfs.cmd , then stats |
|
hwclock |
cat '#r/rtc' |
ifconfig or ip |
ip/ipconfig |
ip addr show |
cat /net/ndb or cat /net/ipselftab |
kill -s STOP pid |
stop procname | rc or echo stop > /proc/pid/ctl |
kill -s CONT pid |
start procname | rc or echo start > /proc/pid/ctl |
kill -9 pid |
kill procname | rc , Kill procname | rc , and slay procname | rc |
lspci |
pci -v and sysinfo |
mount and unmount |
bind , mount , unmount , srv , import , exportfs , etc. |
ln |
bind |
fpaste or pastebinit |
webpaste |
nslookup |
ndb/dnsquery |
paste [file] |
pr -m [file] |
netstat |
netstat or cat /net/iproute |
netcat -l |
aux/listen1 -t tcp!*!$port command |
netcat google.com 80 |
con -Cl tcp!google.com!80 |
ssh |
For other Plan 9 machines: rcpu and srv |
For UNIX machines: ssh and sshfs |
|
id and whoami |
whois $user |
find |
By name: du -a | grep pattern and grep pattern `{du -a root} |
By content pattern: grep -n pattern `{du -a root | awk '{print $2}'} |
|
find -exec cp '{}' x ';' |
cp `{ du -a | grep pattern } x |
cut |
awk -F … |
crontab -e |
sam /cron/$user/cron |
wget and curl |
hget and hpost |
mount -t nfs $ip:/share /mnt/share |
nfs $ip |
expr |
hoc -e |
qemu-system-i386 and qemu-system-x86_64 |
vmx |
GUI Programs
UNIX | Plan 9 |
---|---|
vlock |
screenlock |
xwininfo |
winwatch |
xclock |
games/catclock , clock , or faces |
xload |
stats -l |
xv file.jpg |
page file.jpg |
xbiff |
faces |
firefox , etc. |
webfs via mothra and abaco |
Shell Constructs
bash | rc |
---|---|
export PATH=$PATH:/dir |
bind -a /dir /bin |
`command` |
`{command} |
~/ |
$home/ |
"$@" |
$* |
1>&2 |
>[2=1] |
source /file |
. /file |
!! |
"" |
Files
UNIX | Plan 9 |
---|---|
~/.profile |
$home/lib/profile |
/home |
/usr |
/var/log |
/sys/log |
/usr/lib |
/$objtype/lib |
/usr/include |
/$objtype/include and /sys/include |
/usr/bin |
/$objtype/bin |
/boot |
9fs 9fat , /n/9fat |