Pocket Cmds
Pocket Cmds
Admin Commands
This document will cover the Unix Admin commands that are largely the same on all flavors of Unix.
NIS
ypcat (group, passwd) ypstart # linux ypbind ypinit # client, specify machines to bind to # server, specify whether master or slave ypwhich # tell what NIS server machine is bound to. passwd yppasswd (obsolete, for combatibility only) ypcat -k auto.master ypcat -k auto.direct (-k to display the key name too!) (the direct map, use /-) # list of ypservers that can be used (non
passwd pwconv passwd chown update shadow file based on new user additon to passwd (does not set password) [uid] change password for user [uid]:[gid] /home/[user] change user home dir ownership
Config Files
/etc/passwd /etc/groups /etc/shadow /etc/group /etc/init.d/ (linux: /etc/rc.d/init.d/) /etc/inet/inetd.conf /etc/printcap or /etc/printer.conf /etc/motd /etc/release # see which os cd was used eg sol 8 01/00 for Jan 2000 build. /etc/resolv.conf # dns setup /etc/nsswitch.conf # order of search for files/dns/nis /etc/init.d/ # list of programs that are configured for possible start up/shutdown automatically. # actual start in /etc/rc2.d and rc3.d
CMD
dmesg : display error log messages, like /var/adm/message, etc obsolete by syslogd
du -kxS * = display space usage Summary for only (x) one file sys (ie local) -d = solaris native du, do not cross fs boundary, good for du -dsk / and only report ufs, sans nfs. BUT du -dsk * will cross ufs and nfs that are mounted at the root level, such as /nfshome :( -x = gnu du, "only 1 fs", but only Linux has desired behaviour like solaris -d du -dk / | sort -n | less # use in solaris du -skx * | sort -n | less # use in linux ?? df -kl rpcinfo rpcinfo rpcinfo rpcinfo rpcinfo = report fs space usage of local fs, solaris and linux -b ypserv 1 (and 2) find out all nis server on the subnet -p tin-linux : show all rpc progs on machine tin-linux -n 2049 -u tin-linux 100003 : see if nfs server is running -n 802 -u tin-linux 100005 : see mountd info -n 1048 -u tin-linux 100005 : see mountd info # note that mountd port may differ, see output of rpcinfo -p
nice, renice, priocntl: change scheduling priority of process (ps/top, higher priority has higher numberic value 0=lowest, 100?=highest nice, higher number = nicer = lower priority -ve value of nice means not-nice, ie get more sys res, settable by root) eg renice 10 -p [pid] : renice the process to 10 (from usual 0), thus making it to have less priority and demand less sys resource priocntl -s -p -5 -i pid 8200 : set the priority of process #8200 to -5. -s = set -p = priority -i pid = specify class of process, can group by parent pid, etc.
date --set [datestring] : linux, set date/time of machine, the string can almost be anything. catman -w -M /usr/local/man : rebuild the man page index for the dir /usr/local/man catman -w : probably rebuild based on $MANPATH
uptime allow for 5.26 min of downtime in 1 year. allow for 52 min of downtime. allow for 263 min of downtime, a bit less than 4.5 hours. allow for 526 min of downtime, a bit less than 10 hours.
TBD
old *.ref file content in here.