ºìÁªLinuxÃÅ»§
Linux°ïÖú

AIX³£ÓõÄϵͳ״̬²éѯÃüÁî

·¢²¼Ê±¼ä:2006-09-10 00:34:45À´Ô´:ºìÁª×÷Õß:phpjava
³£ÓõÄϵͳ״̬²éѯÃüÁ
# lsdev -C -s scsi
Áгö¸÷¸öSCSIÉ豸µÄËùÓÐÏà¹ØÐÅÏ¢£ºÈçÂß¼­µ¥ÔªºÅ£¬Ó²¼þµØÖ·¼°É豸ÎļþÃûµÈ¡£
# ps -ef
ÁгöÕýÔÚÔËÐеÄËùÓнø³ÌµÄ¸÷ÖÖÐÅÏ¢£ºÈç½ø³ÌºÅ¼°½ø³ÌÃûµÈ¡£
# netstat -rn
ÁгöÍø¿¨×´Ì¬¼°Â·ÓÉÐÅÏ¢µÈ¡£
# netstat -in
ÁгöÍø¿¨×´Ì¬¼°ÍøÂçÅäÖÃÐÅÏ¢¡£
# df -k
ÁгöÒѼÓÔصÄÂß¼­¾í¼°Æä´óСÐÅÏ¢¡£
# mount
ÁгöÒѼÓÔصÄÂß¼­¾í¼°Æä¼ÓÔØλÖá£
# uname -a
ÁгöϵͳID ºÅ£¬ÏµÍ³Ãû³Æ£¬OS°æ±¾µÈÐÅÏ¢¡£
# hostname
ÁгöϵͳÍøÂçÃû³Æ¡£
# lsvg -l rootvg,lsvg -p rootvg
ÏÔʾÂß¼­¾í×éÐÅÏ¢£¬Èç°üº¬ÄÄЩÎïÀíÅ̼°Âß¼­¾íµÈ¡£
# lslv -l datalv,lslv -p datalv
ÏÔʾÂß¼­¾í¸÷ÖÖÐÅÏ¢£¬Èç°üº¬ÄÄЩÅÌ£¬ÊÇ·ñÓоµÏñµÈ¡£
°Ë ÍøÂç¹ÊÕ϶¨Î»·½·¨
ÍøÂ粻ͨµÄÕï¶Ï¹ý³Ì£º
ifconfig ²é¿´Íø¿¨ÊÇ·ñÆô¶¯ (up)
netstat -i ²é¿´Íø¿¨×´Ì¬
Ierrs/Ipkts ºÍ Oerrs/OpktsÊÇ·ñ>1%
ping×Ô¼ºÍø¿¨µØÖ· (ip µØÖ·)
pingÆäËü»úÆ÷µØÖ·£¬È粻ͨ£¬ÔÚÆä»úÆ÷ÉÏÓÃdiag¼ì²âÍø¿¨ÊÇ·ñÓÐÎÊÌâ¡£
ÔÚͬһÍøÖУ¬ subnetmask Ó¦Ò»Ö¡£
ÍøÂçÅäÖõĻù±¾·½·¨£º
(1) ÈçÐèÐÞ¸ÄÍøÂçµØÖ·¡¢Ö÷»úÃûµÈ£¬Ò»¶¨ÒªÓà chdev ÃüÁî
# chdev -l inet0 -a hostname=myhost
# chdev -l en0 -a netaddr='9.3.240.58' -a netmask=255.255.255.0¡¯
(2) ²é¿´Íø¿¨×´Ì¬£º# lsdev -Cc if
(3) È·ÈÏÍøÂçµØÖ·£º# ifconfig en0
(4) Æô¶¯Íø¿¨£º# ifconfig en0 up
(5) ÅäÖ÷ÓÉ
ÓÐÁ½ÖÖ·½Ê½¼ÓÈë·ÓÉ£º
ÓÀ¾Ã·ÓÉ
# chdev -l inet0 -a route=¡¯10.47.0.0¡¯,¡¯9.3.240.59¡¯
ÁÙʱ·ÓÉ
# route add 10.47.1.2 9.3.240.59
ÓÃÃüÁî netstat -rn ²é¿´Â·Óɱí
¸½£º³£ÓÃÃüÁîÁÐ±í£º[code]Any XXXX, ####, ****, or X is to be substituted by a name, resource name or #,
fn = filename
DIR = Directory
| = pipe symbol
bosboot -a -d /dev/hdiskx -rebuilds boot record/image on boot device(hdiskx)
cat -view contents of a file
cat /tmp/****.1 -view a file, look at output
cat fn fn > newfile -combines two files to a single file
cd -will return you to default DIR
cd / -will put in root DIR
cd /xxxx -change you to a DIR anywhere is system
cd .. -will drop you out of 1 DIR at a time
cd xxxxx -will change you to a DIR in current dir
cfgmgr -will auto config devices
cfgmgr -v & -(-v) shows processes (&) puts in background
chps -s xx hd# -increase paging space (xx=# of addt'l PPs)
cp oldfn newfn -copy a file
cp oldfn Dirn -copy a file to another directory
crontab -l -list crontab entries for the current user
ctrl + v -will page down 1 page
ctrl + 6 -will page up 1 page
del fn -same as rm -i,promts to remove fn
df -I -shows status of file systems (no inodes)
df -Ik -(k) show status in 1024 bites(1mb)(only AIX 4
diag -a -updates changes in hardware configuration
diag ***** -****= a device type(as tape,disk....Fastpath)
diag -cd rmtX -resets tape drive
dosformat -formats a diskette to DOS
dosdir -list files on dos formated diskette
dosread XX YY -copies dos file XX to aix file YY
doswrite YY XX -copies aix file YY to dos file XX
errpt -generates a one line synopsis of logged errors
errpt | pg -list errorlog 1 page @ a time(1st column is ID)
errpt -a -displays detailed information of logged errors
errpt -s Mmddhhmmyy -select entries posted later than date
errpt -aj XXXXXXX -list detail error by ID number.(XXX=1st column)
errpt -d S -list software errors
errpt -j XXXXXXX -list summary report by ID number.
errpt -aN XXXXXX -list detailed report by resource name column
errpt -N XXXXXXX -list summary report by resource name column
errclear 0 -clears errorlog
errclear -N XXXXX 0 -clears errorlog by resource name, 0=all enter
errclear -j XXXXX 0 -clears errorlog by ID number.
finger -same as who but with more details
flcopy -copies a diskette to another diskette
format -formats a diskette in default diskette drive
format -l -formats in lower denity: 1.44 on 2.44 / 720 on 1.44
hostname -responds with host system name
host (hostname) -responds with internet address
instfix -ik IPAR# -lists ipar fix was completely installed
lppchk -v -checks install status of LPPs
lppchk -v 2> /dev/lpX -sends output of lppchk to printer lpx
lpstat -a all -view all printer queues
lptest 80 5 > /dev/lp0 -send test pattern to lp0
ls -list names of files & directories in current dir
ls -lia -list details of files, current dir & subdir
ls -al -list details of files or dir in current dir
lsattr -El xxxxxx -list specific settings on a device
lsdev -C | sort -d -f -list system hardware (devices)
lsdev -C | grep 00-0X -list resourses for a adapter
lsdev -Cc xxxxx -H -list devices(xxx=tty,printer,disk,memory,adpt
lsdev -Cs scsi -list scsi devices(not serial or raid)
lsdev -Cc tape -list tape devices
lsdev -Cs pci -list pci devices
lsdev -Cs isa -list isa devices
lscons -lists the assigned console
lscfg -list hardware list (same as diags list)
lscfg -rl mem* |pg -lists the memory on PCI bus machines
lscfg -vl XXXXX -list config info from a device.(rmt0,hdisk,etc)
lscfg -vl sysplanar0 -lists the machine type, model, s/n on SMP
lsfs -list all filesystems + data from "df" cmd
lslpp -l | grep BROKEN -lists incomplete ptfs
lslv -m hd5 -finds boot drive under pv1 column
lsps -a -checks available paging space
lsps -s -checks available paging space
lspv -lists information about the physical volumes
lspv hdisk# -list drive info
lspv -l hdisk# -lists logical volume group disk in
lsuser -f ALL -lists all attributes for all users
lsvg -lists volume groups
lsvg -p XXXXXX -lists disks in volume group (xxxxx= volume name)
more -reads files and displays the text one screen at a time.
mpcfg -df -list all setting the machine is set to (smp)
mpcfg -cf 11 1 -changes to fast IPL on SMP machines (smp)
mv fn (path fn) -move and rename a file
oslevel -shows AIX version (3.2.4 and above)
pg -reads and displays text one screen at a time.
pdisable -makes unavailable or shows all disabled tty's
pdisable tty# -disables a tty
penable -makes available or shows all enabled tty's
penable tty# -enables a tty
ps -el |pg -look at process running on system
pwd -list what DIR you are currently in
r -repeats last command
rm -i ******* -remove a file & will prompt you if you are sure
rmdev -l XXXXX -removes a device and defines it to data base
rmdev -l XXXXX -d -removes a device and deletes it from data base
set -o vi -sets up to veiw cammands that have been run
:wq -write(save) and quit file
Esc + k -used with SET command to list last command
k,l -k=list next command ran, l=steps you thru command
I -use with SET command inserts characters
j -steps you backwards
cw -cw=removes a word,just type in new word
(use with Esc)
a,x,r -a=added text, x=delete text, r=replace text(r+letter)
R -lets you type over letters or words
smit ***** -(*****= tape,disk,tty,etc.fastpath)
su -stands for switch user,(NOT super user)
su -switches to root id or prompts you for password
su XXXXXX -switches to XXXXXX's id
tar -cvf /dev/rmtX /etc -will copy /etc to a tape drive
tar -tvf /dev/rmtX -will read a tape drive
tctl -f /dev/rmtX rewoffl -rewind & eject tape
tctl -f /dev/rmtX.1 fsf 3 -forward advances a tape to be read by TAR
tctl -F -list avail commands(-F flag is not correct)
tctl retension -retensions tape in tape drive
& -put any command in background with process ID
uptime -how long since last IPL and how many users on system
vmstat # # -reports virtual memory statistics and more
iostat # # -reports CPU,disk & cdrom statistics
use with vm & iostat -1st #(how many sec to repeat), 2nd #(how many times)
who -shows users on system
who am i -shows user id on your terminal & tty number
USE the following with other commands.
---------------------------------------------------
>/tmp/****.1 -creates a file (used with lsXXX command)
>/dev/lp# -redirectes output to a printer(use with a comd)
|grep -is useful to search for text in a file.
|pg -use after any command to view one page at a time
| -pipe sign - Takes the output of one command and
feeds it to the input of another.
> -redirect sign or greater than sign
/ -slash sign
\ -back slash sign
>> -double redirect will add text to end of file
& -put any command in background with process ID
MUST unmount file system 1st to run fsck & dfsck/only use with a problem
----------------------------------------------------------------------------------------------
fsck XXXXXXX -will check a file system for errors & prompt
dfsck /XXXX /XXXX -will check 2 different file sys at the same time
FOLLOWING command lines will delete a group of devices as a group, the #,
sign is the hdisk#'s that you want to delete.(this is an exampe.)
--------------------------------------------------------------------------------------------------
for disk in # # # # -this line and the next 3 line work together
do -the prompt will be > (REMEMBER to hit enter)
rmdev -l hdisk# {disk} -d -the prompt will be > (brackets around disk change)
done -the prompt will be > (on a printout. change to -)
SSA RELATED COMMANDS
-----------------------------------------
lsattr -El ssaX -list attributes of SSA adapters
lscfg -vl ssaX -list VPD of SSA adapters
lsdev -C | grep SSA -list all SSA devices
lslpp -L | grep SSA -list SSA device drivers
maymap -ap -maymap display of SSA loop
maymap -alph -maymap display of SSA loop
lscfg -vl pdisk* -list VPD of pdisks
ssaxlate -l hdiskX -list hdisk to pdisk assignment
ssaxlate -l pdiskX -list pdisk to hdisk assignment
ssa_rescheck -l hdiskX -show hdisk reservation status
FOLLOWING CMDS LIST, COPY, AND RESTORE FOR cpio,tar,dd,backup,dos:
NOTE: The fd0 is just a dev. so you may use any media you desire.
-----------------------------------------------------------------------------------
LIST COPY
------ --------
cpio -itv < /dev/fd0 ls /tmp/fn | cpio -ov > /dev/fd0
tar -tvf /dev/fd0 tar -cvf /dev/fd0 fn
dd li -l | dd dd if=fn of=/dev/fd0
restore -Tf /dev/fd0 backup -0 -uf /dev/fd0 fn By INODE
restore -Tf /dev/fd0 find / -print | backup -i -f/dev/fd0 By NAME
dosdir doswrite -a (AIX fn) (fn.ext)
TO RESTORE
-------------------
cpio -iv fn < /dev/fd0
tar -xvf /dev/fd0
dd of=/dev/fd0 if=fn
restore -xvf /dev/fd0 fn BY NAME/INODE, restore understands unless special
flags were used.
dosread -a (fn.ext) (AIX fn)
TO DOCUMENT THE SYSTEM
-------------------------------------------
lscfg -v > /dev/lpx -to list sys config/VPD
lsuser -f ALL > /dev/lpX -to list users
lsdev -Cc tty -H -to list all tty's
lsdev -Cc lp -H -to list all lp's
lsattr -El ttyX > /dev/lpX -to list ttyX parameters (do for each tty)
lsattr -El lpX > /dev/lpX -to list lpX parameters (do for each lp)
lpstat > /dev/lpX -to list queues
lsfs > /dev/lpx -to list filesystems
lspv > /dev/lpx -to list hard drives
lspv hdiskx -to list hard drive config (do for each drive)
lspv -l hdiskx -to list files on drive
lsvg rootvg -to list rootvg data
plus printout of or save to diskette:
------------------------------------------
/etc/inittab
/etc/objrepos/Cu*
/etc/passwd
/etc/filesystems
/etc/security/passwd
/etc/hosts
/sbin/rc.boot[/code]--------------------------------------------------------------------------------
²é¿´½»»»ÇøÐÅÏ¢£º
lsps -a ÏÔʾ½»»»ÇøµÄ·Ö²¼ÐÅÏ¢
lsps -s ÏÔʾ½»»»ÇøµÄʹÓÃÐÅÏ¢
slibclean Çå³ý´¦Àí³ÌÐòÒÅÁôµÄ¾É·ÖÒ³ÐÅÏ¢
smit mkps ½¨Á¢½»»»Çø¿Õ¼äÐÅÏ¢
swapon -a Æô¶¯ËùÓеķÖÒ³¿Õ¼ä
/etc/swapspaces ´æ·Å·ÖÒ³¿Õ¼ä±í¸ñÐÅÏ¢
ÏÔʾ¾íÐÅÏ¢£º
lsvg ÏÔʾ¾íµÄÃû³Æ
lsvg -l rootvg ÏÔʾrootvg¾íµÄÏêϸÐÅÏ¢

mount¾íµÄ·½·¨£º
varyonvg datavg ¼ÓÔØdatavg¾í
mount /dev/data1 ¼ÓÔØdatavgϵÄÒ»¸ödata1¾í

ÂãÉ豸ÀàÐÍ£ºraw,jfs jfs¿ÉÒÔת±ä³ÉÎļþϵͳ£¬¶ørawÔò²»ÐÐ

ÔÚÂãÉ豸ÉÏ°²×°oracleϵͳ£º
ÐÞ¸ÄÂãÉ豸µÄȨÏÞ£¬ÈçÂãÉ豸ÃûΪsystem01£¬°²×°Êý¾Ý¿âÓû§Îªoracle
chown oracle:dba /dev/system01
chown oracle:dba /dev/rsystem01
ÔÚʹÓÃÎļþʱ±ØÐëÓÃrsystem01

smit¿ìËÙ·¾¶Ãû³Æ£º(smit£ºÍ¼Ðη½Ê½£¬smitty£º×Ö·û·½Ê½)
dev É豸¹ÜÀí
diag Õï¶Ï
jfs ¶¨ÆÚµµ°¸¹ÜÀíϵͳ
lvm Âß¼­¾í²áϵͳ¹ÜÀíÔ±¹ÜÀí
nfs NFS¹ÜÀí
sinstallp Èí¼þ°²×°¼°Î¬»¤
spooler ÁÐÓ¡¶ÓÁйÜÀí
system ϵͳ¹ÜÀí
tcpip TCP/IP¹ÜÀí
USER ʹÓÃÕß¹ÜÀí
clstart£¬clstop£ºÆô¶¯ºÍÍ£Ö¹cluster
lssrc -g cluser£º²é¿´cluserµÄ״̬

²é¿´ÒÑ°²×°µÄÈí¼þÐÅÏ¢£º
ls -aF /usr/lpp (lppicensed Program Products)
²é¿´°²×°Ã½ÌåÄÚÈÝ£º
installp -q -d /dev/cdrom -l

Æô¶¯Ê±×Ô¶¯¼ÓÔØÎļþϵͳÐÅÏ¢£º
ÐèÒª¼ÓÔصÄÐÅÏ¢´æ·ÅÔÚ/etc/filesystems
mount -t nf ¼ÓÔØËùÓÐÔÚ/ect/filesystemsÖж¨Òåtype=nfsµÄÎļþϵͳ
ÏÔʾÒѼÓÔصÄÎļþϵͳ¼°×´Ì¬£º df -v,mount

²é¿´´íÎóÈÕÖ¾ÐÅÏ¢£º
errpt -a

ÓйØTCP/IPµÄÃüÁî
Íø·¿¨£º
smit chgenet,chgtok,chgfddi,opschange,mktty:adptr¼Ü¹¹¿ìËÙ·¾¶
smit mkinet,ppp:slipÓëppp¿ìËÙ·¾¶
ifconfig:config½çÃæ
λַ£º
/etc/hosts ¾²Ì¬Ö÷»ú±í
/etc/named.boot Ãû³Æ·þÎñÆ÷¼Ü¹¹
/etc/named.ca ¸ùÃû³Æ·þÎñÆ÷¿ìÈ¡
/etc/named.data λַÁбí
/etc/named.rev ·´×ªÖ¸±êÁбí
nslookup ²éѯÃû³Æ·þÎñÆ÷×ÊѶ
ÍøÂç·ÓÉ£º
route ¹ÜÀí·ÓÉ
netstat -rn Áгö¶¨ÒåµÄ·ÓÉ
routed ·ÓÉ(daekmin rip)
gated ·ÓÉ(daekmin rip¡¢egp¡¢hello)
/etc/gateways ÒÑÖªÍø¹Ø
/etc/networks ÒÑÖªÍø·
·þÎñ£º
/etc/services
TCP/IPȺ×é×Óϵͳ:
startsrc -g tcpip Æô¶¯È«²¿µÄtcpip×Óϵͳ
startsrc -s inetd Æô¶¯Ö÷Òªinternet
³ý´í£º
iptrace Æô¶¯·â°ü×·×Ù
ipreport ×·×Ù½á¹û¸ñʽ»¯Êä³ö
netstat ÍøÂçͳ¼Æ
ping ¼ì²éÊÇ·ñ¿ÉÒÔµ½´ï
²é¿´HACMP£¬ÍⲿӲÅÌÐÅÏ¢:
lscfg -v
lsdev -Cc adapter
¶ÔµÈ»úÆ÷ÐÅÏ¢£º
/etc/.rhosts
/etc/hosts.equiv
/etc/hosts
¹Û²ì½ø³ÌÄÚ´æʹÓÃÇé¿ö£º
ps aux ¹Û²ì²ÎÊý%mem£ºÄÚ´æʹÓÃ°Ù·Ö±È RSS:ʵ¼ÊʹÓÃÄÚ´æ
vmstat freeµÄµ¥Î»Îª¿é£¬È±Ê¡ÖµÎª4096bytst
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ