From mboxrd@z Thu Jan 1 00:00:00 1970 From: rsc@plan9.bell-labs.com Message-Id: <200006151914.PAA06832@smtp1.fas.harvard.edu> Date: Thu, 15 Jun 2000 15:14:29 -0400 To: 9fans@cse.psu.edu Subject: Re: [9fans] UNIX to Plan9 Command Translation? MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: bf50098e-eac8-11e9-9e20-41e7f4b1d025 Brian Kernighan wrote for the second edition, ``Plan 9 is not UNIX. If you think of it as UNIX, you'll often be frustrated because something doesn't exist or works differently. If you think of it as Plan 9, however, you'll find that most of it works very smoothly, and that there are some truly neat ideas that make things much cleaner than you have seen before''. That quoted, I sometimes miss df and uptime too. df(1) ? There's no way to do this in the file protocol, so in general, you can't. The last paragraph of the "The File Server" section in the Plan 9 from Bell Labs paper explains one reason why. A shell script a bit large to post here works on kfs partitions. hget http://plan9.bell-labs.com/~rsc/plan9/df more(1) p (I want less(1), actually.) Experiment with scroll mode and noscroll mode in rio's button 2 menu. shutdown(1m) disk/kfscmd halt (and?) And Ctl-Alt-Del or ^T^Tr. If you're booting from a network file server (and thus have no kfs local disk), you can just turn the machine off. It takes a little getting used to. id(1) ? cat /dev/user echo $user grep $user /adm/users id(1) doesn't really make too much sense, since who you are depends on which file server you are speaking with. I am the plan9.bell-labs.com rsc on some 9P connections, the eecs.harvard.edu rsc on other 9P connections, and just none on some u9fs over SSH connections. find(1) ? (!) du -a | awk '{print $2}' is usually a good start. apropos(1) ? man(1) is usually enough that this hasn't been done. uptime(1) ? cat /dev/time (see cons(3))/ A shell script a bit too ugly to post here is at hget http://plan9.bell-labs.com/~rsc/plan9/uptime, netstat(1m) [-r flag] ? cat /dev/iproute (see ip(3)) last(1) ? This doesn't make a whole lot of sense even in UNIX. Since we don't have ttys, it makes even less sense here -- when do you log and when do you not? What's the difference between someone who is logged in and a cron job running as that person? How can you tell? vmstat(1m) ? cat /dev/swap stats -mw gets you some of that. iostat(1m) ? nfsstat(1m) ? (for 9fs) Poke around in '#z' and have a look at /sys/src/9/port/devmntstats.c snoop(1m) ? tcpdump(1) ? snoopy(8) ufs{dump|restore}(1m) ? pkginfo(1m) ? mkfs(8) and wrap(8). Russ