Linux下常用的系统状态查询命令介绍 tips

上一篇 / 下一篇  2007-03-30 13:55:34 / 个人分类:LAMP

  有些我也不知道 :) 并且本文尚未查证,发现错误请通知,见错就改 ……木铎校园 BBS 社区t y0s|6L;S*K,F+X
木铎校园 BBS 社区(~N"Ux"o
   列出各个SCSI设备的所有相关信息:如逻辑单元号,硬件地址及设备文件名等。木铎校园 BBS 社区r|UL'vKyK3_
  # ps -ef
3]F`Bi*D\#V G0  列出正在运行的所有进程的各种信息:如进程号及进程名等。
Y%v0cM.rd*I0  # netstat -rn
J&l&Ef_8d&S$sM0  列出网卡状态及路由信息等。
m6ex y5P\4Y!b$IHV0  # netstat -in木铎校园 BBS 社区GxW7b&y/@
  列出网卡状态及网络配置信息。
K\C*k u!T ]z!G6Q%du0  # df -k木铎校园 BBS 社区f2G{3_I-Y.a Ru
  列出已加载的逻辑卷及其大小信息。木铎校园 BBS 社区r9\*?|X#pAS4[e
  # mount木铎校园 BBS 社区4A wq;z5u1g
  列出已加载的逻辑卷及其加载位置。
&R7I['`3`0  # uname -a
DY)mqL'N'?0  列出系统ID 号,系统名称,OS版本等信息。
.WTaYPAz:T0  # hostname
*cXu8IUr4{o0  列出系统网络名称。木铎校园 BBS 社区 X o'f|/f,@l+K
  # lsvg –l rootvg,lsvg –p rootvg木铎校园 BBS 社区.t_ w ~B#s \
  显示逻辑卷组信息,如包含哪些物理盘及逻辑卷等。
8_7l2r2Z D2l5W1{0  # lslv –l datalv,lslv –p datalv木铎校园 BBS 社区 I[6Xx7q;r-mR
  显示逻辑卷各种信息,如包含哪些盘,是否有镜像等。
-~*J`'Y#]9sj0zIN(KO!PP0  八 网络故障定位方法
+v:}'NA-u5R6k1~%o@0  网络不通的诊断过程:
;g{H"P rk&^!T0  ifconfig 查看网卡是否启动 (up)木铎校园 BBS 社区j[zg9J(\#n
  netstat –i 查看网卡状态
dT!~8x}]AG0  Ierrs/Ipkts 和 Oerrs/Opkts是否>1%木铎校园 BBS 社区?5B'ZZ d+CT
  ping自己网卡地址 (ip 地址)
[U#Xzt$VU6H0  ping其它机器地址,如不通,在其机器上用diag检测网卡是否有问题。木铎校园 BBS 社区u}A-d a'H}Qx"u
  在同一网中, subnetmask 应一致。
)Jh;`6U j3`W:L0  网络配置的基本方法:
!r3V4IG k N\u0  (1) 如需修改网络地址、主机名等,一定要用 chdev 命令
]t'k,|6H7]0  # chdev –l inet0 –a hostname=myhost木铎校园 BBS 社区H,}'h ~NJg|
  # chdev -l en0 -a netaddr='9.3.240.58' -a netmask=255.255.255.0’
xN9h.q2GmXSl6Vq0  (2) 查看网卡状态:# lsdev –Cc if
\8gC-J7x Z3d6k/h(O0  (3) 确认网络地址:# ifconfig en0
&a1Iob7juUbFH"a0  (4) 启动网卡:# ifconfig en0 up木铎校园 BBS 社区 i9K8As|)yi
  (5) 配置路由
-BW"J,T*aYx5t;V0  有两种方式加入路由:
[I H[o5sHl1g:R0  永久路由
l|[Q-_i`0  # chdev -l inet0 -a route=’10.47.0.0’,’9.3.240.59’木铎校园 BBS 社区:Lo#[^1~6Sk
  临时路由木铎校园 BBS 社区!~;l.r3z.hA-a*Y.u!Z
  # route add 10.47.1.2 9.3.240.59
?.{ p,joX0  用命令 netstat -rn 查看路由表
!A \K+Io _3j B,R0  附:常用命令列表:木铎校园 BBS 社区[8`bc+rj4lFA
  Any XXXX, ####, ****, or X is to be substituted by a name, resource name or #,
i0du[*E&J/F0  fn = filename木铎校园 BBS 社区)W-U7ftB_8Ou.m
  DIR = Directory
WL*IRi}*`:{Ui0  | = pipe symbol木铎校园 BBS 社区|'cj1}s&v&h9T rH
  木铎校园 BBS 社区3}]B vGF
  bosboot -a -d /dev/hdiskx -rebuilds boot record/image on boot device(hdiskx)
*DZ(lg3HxLE0  cat -view contents of a file木铎校园 BBS 社区 Hfj.gp|a#m+RU
  cat /tmp/****.1 -view a file, look at output
(u3g_ i&mJOvM2h0  cat fn fn > newfile -combines two files to a single file
,T],I:Z.E:?WxV0  cd -will return you to default DIR
1iv5x&J9Z+s,AB0  cd / -will put in root DIR木铎校园 BBS 社区Tc`#_)ATt
  cd /xxxx -change you to a DIR anywhere is system
J&^]q"?_0  cd .. -will drop you out of 1 DIR at a time木铎校园 BBS 社区5[$i}]pB
  cd xxxxx -will change you to a DIR in current dir木铎校园 BBS 社区)qs&l9P0G
  cfgmgr -will auto config devices木铎校园 BBS 社区9p0p/M#eO ^@yj
  cfgmgr -v & -(-v) shows processes (&) puts in background
H v+}Xu)d0  chps -s xx hd# -increase paging space (xx=# of addt'l PPs)
I@pu P\q3n0  cp oldfn newfn -copy a file木铎校园 BBS 社区#n.Nk D$Ux
  cp oldfn Dirn -copy a file to another directory
x A/b9w'qM3i7W0  crontab -l -list crontab entries for the current user
'pb[,ik!v T9Q d0  ctrl + v -will page down 1 page木铎校园 BBS 社区&g%Z#MnKoaqM
  ctrl + 6 -will page up 1 page
6ebVJ ^;@KQO0  del fn -same as rm -i,promts to remove fn木铎校园 BBS 社区%~;['S*kM2Z2I
  df -I -shows status of file systems (no inodes)木铎校园 BBS 社区E%D(zbtTp
  df -Ik -(k) show status in 1024 bites(1mb)(only AIX 4
*ZGF q IG0  diag -a -updates changes in hardware configuration
)S6QZ6\,VV0  diag ***** -****= a device type(as tape,disk....Fastpath)木铎校园 BBS 社区 W r-U#u3R+Qw
  diag -cd rmtX -resets tape drive木铎校园 BBS 社区?!HM-ZI&S$B
  dosformat -formats a diskette to DOS木铎校园 BBS 社区QW H*k2rd \&M h9y
  dosdir -list files on dos formated diskette木铎校园 BBS 社区tF!ixipr0NU
  dosread XX YY -copies dos file XX to aix file YY木铎校园 BBS 社区 lJ1bw'n&u DR6yk
  doswrite YY XX -copies aix file YY to dos file XX木铎校园 BBS 社区As{-f[2m?
  errpt -generates a one line synopsis of logged errors
wRnq5]*K\0  errpt | pg -list errorlog 1 page @ a time(1st column is ID)
0mH3U!Pcb{ R+a_0  errpt -a -displays detailed information of logged errors木铎校园 BBS 社区*@ C|)p j"K _J
  errpt -s Mmddhhmmyy -select entries posted later than date木铎校园 BBS 社区4Wi.TZ9Fl3v7M
  errpt -aj XXXXXXX -list detail error by ID number.(XXX=1st column)
/J)@)n+vS WJ(Qi)F0  errpt -d S -list software errors
-_&UD9l\D_{0  errpt -j XXXXXXX -list summary report by ID number.
s9t0],ji9v6` Ok P#C~0  errpt -aN XXXXXX -list detailed report by resource name column
/D(^(C;d*zI5I6Mx+i1\+t0  errpt -N XXXXXXX -list summary report by resource name column
#D*me@P ?Y0  errclear 0 -clears errorlog木铎校园 BBS 社区h@#|;^Z(Z+o-i
  errclear -N XXXXX 0 -clears errorlog by resource name, 0=all enter木铎校园 BBS 社区G7J,i,v]n8x6rj
  errclear -j XXXXX 0 -clears errorlog by ID number.木铎校园 BBS 社区if0G2^eJs6A;v
  finger -same as who but with more details
E0E'} ]-e+V/k Ap0  flcopy -copies a diskette to another diskette
:_[P:x2x(V*H/FI0  format -formats a diskette in default diskette drive
tw3Cg [ f9q]0  format -l -formats in lower denity: 1.44 on 2.44 / 720 on 1.44木铎校园 BBS 社区R1T M7eVj9p
  hostname -responds with host system name
%`b{P3M(oc3LpM~![0  host (hostname) -responds with internet address木铎校园 BBS 社区 pv+C |[b;p7x-l!W
  instfix -ik IPAR# -lists ipar fix was completely installed木铎校园 BBS 社区 c*l?EUt
  lppchk -v -checks install status of LPPs木铎校园 BBS 社区1jpL}3V4L\
  lppchk -v 2> /dev/lpX -sends output of lppchk to printer lpx木铎校园 BBS 社区(e$Om$d`?a
  lpstat -a all -view all printer queues
x!_~S9U0  lptest 80 5 > /dev/lp0 -send test pattern to lp0
6b {FU v0  ls -list names of files & directories in current dir
bi`_k4l*P0  ls -lia -list details of files, current dir & subdir木铎校园 BBS 社区'^E"b&]fkC
  ls -al -list details of files or dir in current dir
Qn|+kB.v^#bx0  lsattr -El xxxxxx -list specific settings on a device木铎校园 BBS 社区:eX8U%x'Z c}']
  lsdev -C | sort -d -f -list system hardware (devices)
,j-j(NDD\(l"l0  lsdev -C | grep 00-0X -list resourses for a adapter木铎校园 BBS 社区)R Zi6eY-]:^(K;oO
  lsdev -Cc xxxxx -H -list devices(xxx=tty,printer,disk,memory,adpt木铎校园 BBS 社区8|$}IiFP#]
  lsdev -Cs scsi -list scsi devices(not serial or raid)
||G$?r)t2H+G0  lsdev -Cc tape -list tape devices木铎校园 BBS 社区9Xrk r%{sV
  lsdev -Cs pci -list pci devices
apQD R0  lsdev -Cs isa -list isa devices
SG6~I`-X0  lscons -lists the assigned console
X4nt} l0  lscfg -list hardware list (same as diags list)木铎校园 BBS 社区 QT;a2ID+E~3r
  lscfg -rl mem* |pg -lists the memory on PCI bus machines
f1XsWAR \]-H:_/v0  lscfg -vl XXXXX -list config info from a device.(rmt0,hdisk,etc)木铎校园 BBS 社区W2b;|3CDWx!@
  lscfg -vl sysplanar0 -lists the machine type, model, s/n on SMP
|Cm;}'i5N(K?)t0  lsfs -list all filesystems + data from "df" cmd木铎校园 BBS 社区:zH`A8M` ` q
  lslpp -l | grep BROKEN -lists incomplete ptfs
;En@rW|@&s0  lslv -m hd5 -finds boot drive under pv1 column木铎校园 BBS 社区XC u3^2q4~%V^,Q
  lsps -a -checks available paging space
g sMj:I"b!Gd0  lsps -s -checks available paging space木铎校园 BBS 社区B O+T,@9I2q
  lspv -lists information about the physical volumes
U5D?7H r&\D0  lspv hdisk# -list drive info
e DsQ2G+t3@i#E0  lspv -l hdisk# -lists logical volume group disk in
y4Pf Q*e3B{1w&Y1y0  lsuser -f ALL -lists all attributes for all users
yLu.Z*\8a+Z0  lsvg -lists volume groups
cS;T(|4Z4@n0  lsvg -p XXXXXX -lists disks in volume group (xxxxx= volume name)木铎校园 BBS 社区R"I;J+|1Q)_j xK
  more -reads files and displays the text one screen at a time.木铎校园 BBS 社区8d }qYX;}
  mpcfg -df -list all setting the machine is set to (smp)
W u(A|\0  mpcfg -cf 11 1 -changes to fast IPL on SMP machines (smp)
u0X,V6\^J0  mv fn (path fn) -move and rename a file
O U6J3f @d8})[:m@0  oslevel -shows AIX version (3.2.4 and above)木铎校园 BBS 社区f^,{Jm!pDtl
  pg -reads and displays text one screen at a time.木铎校园 BBS 社区b nf(m6\~_
  pdisable -makes unavailable or shows all disabled tty's木铎校园 BBS 社区9ob.vg-o"}}~kt:J
  pdisable tty# -disables a tty木铎校园 BBS 社区 @ol X.Afq
  penable -makes available or shows all enabled tty's
/Gb4U*qRJ0  penable tty# -enables a tty木铎校园 BBS 社区,EZ#t)GJ5e?3b
  ps -el |pg -look at process running on system
o)X%FANN.Nn?0  pwd -list what DIR you are currently in木铎校园 BBS 社区g h&N.v9lC+\
  r -repeats last command木铎校园 BBS 社区U3s2x+LbQ
  rm -i ******* -remove a file & will prompt you if you are sure木铎校园 BBS 社区`)Ljuqe3Z/Fc*v
  rmdev -l XXXXX -removes a device and defines it to data base
${.ef.N U_K(i0  rmdev -l XXXXX -d -removes a device and deletes it from data base
;sN/vQ*S?SRg0  set -o vi -sets up to veiw cammands that have been run
#k/};UI/x0  :wq -write(save) and quit file
/s c S:W3T)}$[0  Esc + k -used with SET command to list last command木铎校园 BBS 社区~g_n%v[9I d m
  k,l -k=list next command ran, l=steps you thru command木铎校园 BBS 社区 @Lx,\h q
  I -use with SET command inserts characters
%I'^7a8Q,EQ9in0  j -steps you backwards
m8T7dK$n]0  cw -cw=removes a word,just type in new word
n1E4N:[ p:R0  (use with Esc)
#T;U b;^f&R'jiw-Lx0  a,x,r -a=added text, x=delete text, r=replace text(r+letter)
"Q2?/hX'K ^0  R -lets you type over letters or words
N I)s3V-@/R*X9s0  smit ***** -(*****= tape,disk,tty,etc.fastpath)
+Fx%\0Dq4OU n/l0  su -stands for switch user,(NOT super user)
`8uv z7gM0  su -switches to root id or prompts you for password
_2z$D(VW a KG0kS{)_D0  su XXXXXX -switches to XXXXXX's id
,hr,~1J$])BH#sG0  tar -cvf /dev/rmtX /etc -will copy /etc to a tape drive木铎校园 BBS 社区5U(x'A7uS.^{
  tar -tvf /dev/rmtX -will read a tape drive
g-pB7osd3{`0  tctl -f /dev/rmtX rewoffl -rewind & eject tape木铎校园 BBS 社区6[-QHD!m5{
  tctl -f /dev/rmtX.1 fsf 3 -forward advances a tape to be read by TAR木铎校园 BBS 社区#S0A&\i9h2r3df
  tctl -F -list avail commands(-F flag is not correct)
NVH} aw aq0  tctl retension -retensions tape in tape drive木铎校园 BBS 社区u0Ss4d/^2E DYj
  & -put any command in background with process ID

TAG: LAMP

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

关于作者