Thursday, September 27, 2007

Some handy Solaris commands - just a reference to useful options and commands.

set path to something like
PATH=/usr/bin:/usr/ccs/bin:/usr/sbin:/sbin:/usr/platform/`uname -i`/sbin:/usr/proc/bin:/usr/ucb/:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:$HOME/bin

df -n (or fstyp device)

show type of file system (ufs/vxfs)

fuser and pfiles

open files

prtconf -V

OBP level

pgrep, pkill, prstat -a

process info and manipulation

logins -p|-d

local users without passwords | duplicate uids

mpstat, prtdiag, psrinfo -v

processor information and more

traceroute

since Solaris 7

troff -man man.1 | dpost | lp

print old style man pages

sgml2roff lpfilter.1m | troff -man | dpost | lp

print sgml (new) man pages

fstyp -v

list superblock including minfree %

tput

nice screen output

what, ldd, strings

information about binaries

ctrl-V in vi

insert control character

ftp> get README | more

ufsdump 0f - /filesystem | (cd /mnt; ufsrestore rf -); rm /mnt/restoresymtable

dump restore pipe

echo 007

get bell to ring

comm

common (non-common) lines from two files

pkgchk -lp /usr/bin/ls

which package does ls belong to?

df -oi -F ufs

free inodes

icheck -b blockno filesystem

block to file mapping

dircmp, rsync, filesync

compare directories, sync utilities

nohup /var/tmp/myscript.ksh > /var/tmp/myscript.out &

for things which have to complete (no risk of terminal being logged out)

netstat -pn

arp like output when name services are down

pwdx, pldd, ptree

and more in /usr/proc/bin

uname -X

basic system information - one item on each line (useful for scripts)

read

read a line

listusers

another way of listing users

tcopy

copy tape

nfsstat -m (or check /etc/rmtab)

current nfs mount

clear_locks

clear nfs locks

df -h, du -h, ls -lh

since Solaris 9 - output in powers of 1024

No comments: