Solaris Commands

 

Startup and Shutdown

Commands

shutdown -i5 -y -g0 # shutdown now, no questions asked.
shutdown -i6 -y -g0 # reboot now, no questions asked.

Run states

0 ready for power down
1 single-user
2 multiuser w/o netwking
3 multiuser w netwking
4 unused
5 interactive reboot
6 reboot
S singls-user startup

rc Script Directories

rc0 shuts down & start up so it’s
safe to power off. Also shuts
down services & daemons, killing
running processes, & umount fs

rc1 bring system into single usr
mode.Also shuts down services &
daemons, killing running
processes, & umount fs

rc2 starts multiusr op w/ netwking
& nfs support. It also cleanup
/tmp & /var/tmp, loads netwk
interface, starts cron, lp &
sendmail

rc3 starts multiusr mode. Executes
tasks in run state 2 & starts NFS
daemons

rc4 unused

rc5 starts interactive sw reboot. It
prompts for an alternate boot
dev

rc6 reboot system

rcS starts single usr state w/
rcs) some fs mounted

ok Prompt Commands

banner
printenv
.speed, 
.version
set-defaults,test-all
probe-scsi
boot -r
power-off

* Run OBDiag:

ok setenv diag-switch? true
ok setenv auto-boot? false
ok reset-all

* Run POST

ok setenv diag-switch? true
ok setenv diag-level max
ok setenv diag-device disk
ok setenv auto-boot? false
ok reset-all

– power cycle the system
– use show-post-results to view results

ok devalias

Network Setup

sys-unconfig
 
ifconfig -a
ypwhich
ypcat hosts
 
netstat -rn

netscape location

/usr/dt/appconfig/netscape/netscape

Mount nfs

* share dir

share -F nfs -o ro -d "myDir descrip" /myDir

* To make permanent:
– add to /etc/dfs/dfstab
– start nfs svr deamon (need at least one entry to start) /etc/init.d/nfs.server start
* mount nfs

mount -F nfs -o rw mysvr:/myDir /myRmtDir

* mount permanently:
– add to /etc/vfstab
* Example:
cbmsdev1:/opt/weblogic – /weblogic ufs – yes –

Check Solaris Usages

* rss: resident set size: actual ram used by process as opposed to swapped out
* vsz: virtual mem size

Check os

uname

Check Solaris RAM

/usr/sbin/prtconf | grep Memory
 
# or
/usr/sbin/prtconf | grep Memory | awk -F":" '{print $2}'

Check cpu

psrinfo -v
mpstat

Check all disks

cd /dev/rdsk
ls -lL c*t*d*s0

prtdiag

/usr/platform/e250/prtdiag

disk naming

c0 controller zero
t0 target (scsi id) zero
d0 disk zero
s0 slice zero

Misc scripts

untruncated ps output

/usr/ucb/ps auxww

Access /usr/local/man

man -M=/usr/local/man
or
MANPATH=/usr/man:/usr/local/man;export MANPATH

List dir only

ls -F | grep /
find . -type d -print

find out process memory usage

ps -A -o pmem -o pcpu -o args
ps -e -o “rss(k) vsz(k) pmem pid comm” | qrep -v COMMAND | sort -rn | awk ‘{print $1 “\t” $2 “\t” $3 “\t” $4 “\t” $5;}’

ps long listing

/usr/ucb/ps -auxww | grep …

Core Dump Analysis

pstack core | more

* Ref: Core Dump Management on the Solaris OS

This entry was posted in solaris. Bookmark the permalink.