Solaris 管理员常用命令( 二 )



/usr/bin/catman -w
/* Create windex databases for man page directories */

FQ_FILENAME=/* Extract directory from fully-qualified file name. */

mailx -H -u
/* List out mail headers for specified user */

set filec
/* Set file-completion for csh */

uuencode [filename] [filename] | mailx -s "Subject" [user to mail]
/* Send files as attachments */

Hardware

cfgadm
/* Verify reconfigurable hardware resources */

m64config -prconf
/* Print M64 hardware configuration */

m64config -depth 8|24
/* Sets the screen depth of your M64 graphics accelerator */

m64config -res "video_mode"
/* Change the resolution of your M64 graphics accelerator */

Kernel

/usr/sbin/modinfo
/* Display kernel module information */

/usr/sbin/modload
/* Load a kernel module */

/usr/sbin/modunload -i
/* Unload a kernel module */

nm -x /dev/ksyms | grep OBJ | more
/* Tuneable kernel parameters */

/usr/sbin/sysdef
/* Show system kernal tunable details */

Memory

prtconf | grep Mem
/* Display Memory Size */

Network Information

ndd /dev/arp arp_cache_report
/* Prints ARP table in cache with IP and Mac address */

netstat -a | grep EST | wc -l
/* Displays number active established connections to the localhost */

netstat -k hme0
/* Undocumented netstat command */

netstat -i
/* Show the TCP/IP network interfaces */

netstat -np
/* Similar to arp -a without name resolution */

netstat -r
/* Show network route table */

netstat -rn
/* Displays routing information but bypasses hostname lookup. */

netstat -a | more
/* Show the state of all sockets */

traceroute
/* Follow the route to the ipaddress */

Network/Tuning

ifconfig eth0 mtu 1500
/* Change MTU of interface */

ifconfig eth0 10.1.1.1 netmask 255.255.255.255
/* Add an Interface */

/sbin/ifconfig hme0:1 inet 10.210.xx.xxx netmask 255.255.0.0 broadcast 10.210.xxx.xxx
/* Virtual Interfaces */

/sbin/ifconfig hme0:1 up
/* Bring virtual interface up */

/usr/sbin/ndd -set /dev/hme adv_100fdx_cap 1
/* Nailling to 100Mbps */

ndd -set /dev/ip ip_addrs_per_if 1-8192
/* To set more than 256 virtual ip addresses. */

ndd -set /dev/tcp tcp_xmit_hiwat 65535
/* Increase TCP-transmitbuffers */

ndd -set /dev/tcp tcp_recv_hiwat 65535
/* Increase TCP-receivebuffers */

Processes

fuser -uc /var
/* Processes that are running from /var */

kill -HUP `ps -ef | grep [p]roccess | awk "{print $2}"`
/* HUP any related process in one step */

lsof -i TCP:25
/* Mapping port with process */

pfiles
/* Shows processes" current open files */

pkill -n
/* Kill a process by name */

kill `ps -ef | grep program_name | grep -v grep | cut -f8 -d " "`
/* pkill for solaris 2.6 */

prstat -a
/* An alternative for top command */

/usr/ucb/ps -aux | more
/* Displays CPU % usage for each process in ascending order */

/usr/ucb/ps -auxww | grep
/* Gives the full listing of the process (long listing) */

ps -ef | grep -i| awk "{ print $2 }"
/* Creates list of running PID by */

ps -ef | grep -v "0:00" | more
/* Gives you a list of any process with CPU time more than 0:00 */

ps -ef | more
/* Show all processes running */

ps -eo pid,args
/* List processes in simplified format */

ps -fu oracle|grep pmon
/* See which instances of Oracle are running */

/usr/proc/bin/ptree
/* Print the parent/child process "tree" of a process */

/usr/proc/bin/pwdx 【Solaris 管理员常用命令】
/* Print the working directory of a process */

top -b 1
/* Returns the process utilizing the most cpu and quits */

推荐阅读