The Command Line The desktop is where the work starts, but the command line is where a Unix system is understood and repaired. Makronix uses NetBSD's shell, NetBSD's tools and NetBSD's manual pages; nothing here is special to Makronix except the paths of the MCDE programs. The shell The login shell of a new account is sh1, NetBSD's POSIX shell. It reads ~/.profile at login and ~/.shrc for interactive shells. A user who prefers a Korn shell can use /usr/pkg/bin/ksh93 (installed for MCDE's dtksh) and change the login shell with chsh1. The important environment variables are PATH, HOME, SHELL, TERM and LANG. A desktop session gets PATH from the session configuration, not only from ~/.profile; if a program is found in a terminal but not from the panel, compare the two: $ echo $PATH $ env | sort Pipes, redirection and jobs A pipe sends the output of one program to the input of the next; redirection sends it to a file. The three that matter every day: $ dmesg | less $ grep -i error /var/log/messages > /tmp/errors $ command 2>&1 | tee log Ctrl+C stops the program in the foreground, Ctrl+Z suspends it, and bg, fg and jobs manage it. command & starts it in the background. A file's permissions are read with ls -l and changed with chmod1. The three digits are the owner, the group and everybody else; the execute bit is what makes a file a program. A directory needs the execute bit to be entered, and the write bit to be changed. $ chmod 644 notes.txt $ chmod 755 script.sh $ chown user:wheel script.sh Editing files vi1 is in the base system and is the editor to know when the desktop is not running. It has two modes: command mode, where keys are commands, and insert mode, where they are text. i enters insert mode, Esc returns to command mode, :w writes, :q quits and :wq does both. dd deletes a line, /text searches, and u undoes. On the desktop, dtpad1 edits plain text with menus and a search dialog. Configuration files are plain text either way; keep a copy before a large change (cp file file.orig) and compare afterwards with diff1. Finding the documentation man1 reads the manual pages. The sections are 1 (commands), 2 (system calls), 3 (library functions), 4 (devices), 5 (file formats), 7 (conventions) and 8 (administration). The useful forms: $ man ls $ man 5 rc.conf $ man -k firewall $ apropos password man -k searches the one-line descriptions; apropos is the same. The Makronix Guide is a set of pages in section 7, starting at makronix-guide7. The HTML and PDF forms are under /usr/share/doc/makronix. Becoming the administrator Administrative commands run as root. On a desktop, log in as yourself and use su1: $ su - Password: # The minus makes it a login shell, with root's PATH and environment. Your account is in the wheel group, which is what allows su; a terminal that is left alone returns to your prompt when you type exit. Log in as yourself rather than as root: the desktop account is the account for people, and su is the door to the system.