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

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

  有些我也不知道 :) 并且本文尚未查证,发现错误请通知,见错就改 ……木铎校园 BBS 社区4yY T-X(G[f

ku;T9Fh5tfh0   列出各个SCSI设备的所有相关信息:如逻辑单元号,硬件地址及设备文件名等。
,[!KG;b(w@`0  # ps -ef木铎校园 BBS 社区v `/z#Ak'm]
  列出正在运行的所有进程的各种信息:如进程号及进程名等。木铎校园 BBS 社区I6p0BB9l{"T{
  # netstat -rn
$D(Yxa0h$W{0  列出网卡状态及路由信息等。木铎校园 BBS 社区W#HZ7w2\+h/X
  # netstat -in木铎校园 BBS 社区#X`~a\3K Q
  列出网卡状态及网络配置信息。木铎校园 BBS 社区^,GCD g
  # df -k
'kKNKy s0  列出已加载的逻辑卷及其大小信息。木铎校园 BBS 社区Y~Iu q
  # mount
W)V7XXp0  列出已加载的逻辑卷及其加载位置。
%OVga{K8c4\ t.Sl0  # uname -a木铎校园 BBS 社区:M5E3r`Z+{4D8iW
  列出系统ID 号,系统名称,OS版本等信息。
,hh_(hc8V0  # hostname
$i,@7E(S}#U o+U1n0  列出系统网络名称。木铎校园 BBS 社区v8a f/c%w%`5c
  # lsvg –l rootvg,lsvg –p rootvg木铎校园 BBS 社区q!IG,^ k8I.U?$~2z
  显示逻辑卷组信息,如包含哪些物理盘及逻辑卷等。木铎校园 BBS 社区nt;k+TFA%Jev&]$X
  # lslv –l datalv,lslv –p datalv
Y RBKx7^~"}0  显示逻辑卷各种信息,如包含哪些盘,是否有镜像等。
F3h }X hr3C0  八 网络故障定位方法
0]n)^-H$DK.Yx0  网络不通的诊断过程:
6T)P2c2FJ({0  ifconfig 查看网卡是否启动 (up)
dMfc n;xg0  netstat –i 查看网卡状态木铎校园 BBS 社区;f p{a*DQ"{9U-d
  Ierrs/Ipkts 和 Oerrs/Opkts是否>1%木铎校园 BBS 社区N3o._9{ w*M
  ping自己网卡地址 (ip 地址)木铎校园 BBS 社区eBY7?/{r8?|)M_2z
  ping其它机器地址,如不通,在其机器上用diag检测网卡是否有问题。木铎校园 BBS 社区R(kr!de
  在同一网中, subnetmask 应一致。
#e~\4C{'i0  网络配置的基本方法:
:]+jPm7LV6UkB0  (1) 如需修改网络地址、主机名等,一定要用 chdev 命令木铎校园 BBS 社区7p1W5b y/@hul6`
  # chdev –l inet0 –a hostname=myhost
!S*T3pj2DW;]/~0  # chdev -l en0 -a netaddr='9.3.240.58' -a netmask=255.255.255.0’
5|v`gcTi @0  (2) 查看网卡状态:# lsdev –Cc if
p(\(iqf/o{1I0  (3) 确认网络地址:# ifconfig en0木铎校园 BBS 社区:FB-\1_/N$jb~jT2]
  (4) 启动网卡:# ifconfig en0 up
,Ww+X;kw `M(n0  (5) 配置路由
4y^&G{V0j9b [&f7?0  有两种方式加入路由:
*^bh!{3O)b0  永久路由木铎校园 BBS 社区Le3a*e?'f+l
  # chdev -l inet0 -a route=’10.47.0.0’,’9.3.240.59’
6C7iajFF+fk*{0  临时路由木铎校园 BBS 社区fj1GFGi3pD6pK
  # route add 10.47.1.2 9.3.240.59
j~rd+~G|`^~0  用命令 netstat -rn 查看路由表木铎校园 BBS 社区u D*M n/Pnv1k6D
  附:常用命令列表:
~RM4G8c`-I0  Any XXXX, ####, ****, or X is to be substituted by a name, resource name or #,
'y,D |}@(aL0  fn = filename
(x"|n A }%S0  DIR = Directory木铎校园 BBS 社区d3jk&D~.Z$z
  | = pipe symbol木铎校园 BBS 社区 @\ vW5Q:_
  
/`t`jqZQ7h$J0  bosboot -a -d /dev/hdiskx -rebuilds boot record/image on boot device(hdiskx)
{!w:bO'y C oD0  cat -view contents of a file
QTj%S L,IOX0  cat /tmp/****.1 -view a file, look at output木铎校园 BBS 社区eN-[-uU*Oy
  cat fn fn > newfile -combines two files to a single file木铎校园 BBS 社区0El3L] di
  cd -will return you to default DIR木铎校园 BBS 社区of-TJ%z8@
  cd / -will put in root DIR木铎校园 BBS 社区PIat yn
  cd /xxxx -change you to a DIR anywhere is system
V}P,_u(k*?9Z!r0  cd .. -will drop you out of 1 DIR at a time
lmv'zR2K0  cd xxxxx -will change you to a DIR in current dir
)wB|SOyZsP0  cfgmgr -will auto config devices
O*M0qYx;w-E0  cfgmgr -v & -(-v) shows processes (&) puts in background
mGp${)j0  chps -s xx hd# -increase paging space (xx=# of addt'l PPs)
?&ves ?e`^0  cp oldfn newfn -copy a file
8S5o'h7NP\ p0  cp oldfn Dirn -copy a file to another directory木铎校园 BBS 社区,?m%R6k)s{Ss
  crontab -l -list crontab entries for the current user
0IF&JZI+y0  ctrl + v -will page down 1 page
P't(n+q3H\0S+h5YT0  ctrl + 6 -will page up 1 page
%Pz6m i2^/H,|0  del fn -same as rm -i,promts to remove fn木铎校园 BBS 社区%L%cgG2Kv?+HSBW
  df -I -shows status of file systems (no inodes)
aw [ F rS.c.h K0  df -Ik -(k) show status in 1024 bites(1mb)(only AIX 4
yV i,s1i7{0  diag -a -updates changes in hardware configuration
5`LHl g4J0  diag ***** -****= a device type(as tape,disk....Fastpath)木铎校园 BBS 社区1rq(p'|m G.l
  diag -cd rmtX -resets tape drive
(~3C%`gHyK7sD0  dosformat -formats a diskette to DOS
9L'L5R*W-F.l9A0  dosdir -list files on dos formated diskette
,@k[Ov](Vj;?0  dosread XX YY -copies dos file XX to aix file YY木铎校园 BBS 社区)^i0b H3_~
  doswrite YY XX -copies aix file YY to dos file XX木铎校园 BBS 社区3^R,jkq}Hk
  errpt -generates a one line synopsis of logged errors木铎校园 BBS 社区JLc _l\
  errpt | pg -list errorlog 1 page @ a time(1st column is ID)
HY@K1q6Vq/o%V0  errpt -a -displays detailed information of logged errors木铎校园 BBS 社区g _zf:_q w6x#a,t
  errpt -s Mmddhhmmyy -select entries posted later than date木铎校园 BBS 社区3Mw]"F6g4]#S
  errpt -aj XXXXXXX -list detail error by ID number.(XXX=1st column)木铎校园 BBS 社区M1m+P H.`}R\
  errpt -d S -list software errors木铎校园 BBS 社区/X"ho4S0}We!g9L
  errpt -j XXXXXXX -list summary report by ID number.木铎校园 BBS 社区5W}1ZpRe:K+~
  errpt -aN XXXXXX -list detailed report by resource name column
x)|T0w'jJ,J(JV0  errpt -N XXXXXXX -list summary report by resource name column
m7w!L6a;Z{9A8vB5K0  errclear 0 -clears errorlog木铎校园 BBS 社区8}y6R{*tW,s@
  errclear -N XXXXX 0 -clears errorlog by resource name, 0=all enter
sTV3V$w0^f)T0  errclear -j XXXXX 0 -clears errorlog by ID number.木铎校园 BBS 社区eXCsn-K9t
  finger -same as who but with more details木铎校园 BBS 社区O;jq&n-i y
  flcopy -copies a diskette to another diskette木铎校园 BBS 社区K.tTt}*}+{
  format -formats a diskette in default diskette drive
&Rk-s Bwiy"_:t9B0  format -l -formats in lower denity: 1.44 on 2.44 / 720 on 1.44木铎校园 BBS 社区*V2m`WSO
  hostname -responds with host system name
b1Nq2E{i7t.lhy0  host (hostname) -responds with internet address
!Se vno3w1}0  instfix -ik IPAR# -lists ipar fix was completely installed木铎校园 BBS 社区x9xp]s
  lppchk -v -checks install status of LPPs
\){ou2v0  lppchk -v 2> /dev/lpX -sends output of lppchk to printer lpx
Yg;[*E!c @EM0  lpstat -a all -view all printer queues木铎校园 BBS 社区M%q-T9k0R E._ |
  lptest 80 5 > /dev/lp0 -send test pattern to lp0木铎校园 BBS 社区"iaE o&y6Vh-|H
  ls -list names of files & directories in current dir木铎校园 BBS 社区](xm]5vl{J;M
  ls -lia -list details of files, current dir & subdir木铎校园 BBS 社区+K5q;A|7|&P6Sv
  ls -al -list details of files or dir in current dir木铎校园 BBS 社区0\0~QVojjx
  lsattr -El xxxxxx -list specific settings on a device木铎校园 BBS 社区G6m(B(N+g;Ag!h
  lsdev -C | sort -d -f -list system hardware (devices)木铎校园 BBS 社区X6Ep H8Kg%Fu}`.M
  lsdev -C | grep 00-0X -list resourses for a adapter
K?:Ml+~V8Q0  lsdev -Cc xxxxx -H -list devices(xxx=tty,printer,disk,memory,adpt木铎校园 BBS 社区p`S3HY_jg
  lsdev -Cs scsi -list scsi devices(not serial or raid)木铎校园 BBS 社区bf)u`}^F'P
  lsdev -Cc tape -list tape devices
?pm3Xw(f0  lsdev -Cs pci -list pci devices
PZ1M8mLb(nr\1u u0  lsdev -Cs isa -list isa devices木铎校园 BBS 社区'VH o{{I n/~
  lscons -lists the assigned console
ch Y(Nq3Y0  lscfg -list hardware list (same as diags list)木铎校园 BBS 社区O.kw5@*e@`E
  lscfg -rl mem* |pg -lists the memory on PCI bus machines
q$L)g L-g3aZ!ubtW0  lscfg -vl XXXXX -list config info from a device.(rmt0,hdisk,etc)木铎校园 BBS 社区1P)gQ(]_n
  lscfg -vl sysplanar0 -lists the machine type, model, s/n on SMP木铎校园 BBS 社区5jK+lX INAy"g
  lsfs -list all filesystems + data from "df" cmd木铎校园 BBS 社区 Q;FK8_0G/sZ(m}i
  lslpp -l | grep BROKEN -lists incomplete ptfs
S+lfnf3[{3_3~ U0  lslv -m hd5 -finds boot drive under pv1 column木铎校园 BBS 社区3GI9D1K$q
  lsps -a -checks available paging space
/iYH-c j)mt i$m*xB0  lsps -s -checks available paging space木铎校园 BBS 社区 T}a,egM q)I#^
  lspv -lists information about the physical volumes
k3`.ofvn0S3j0  lspv hdisk# -list drive info
W7IZ:Xr,W r4l0  lspv -l hdisk# -lists logical volume group disk in木铎校园 BBS 社区(mjdM;V y.ST)~ `t
  lsuser -f ALL -lists all attributes for all users
)CF-sK+{+iC U t0  lsvg -lists volume groups
Q$M^{puy0  lsvg -p XXXXXX -lists disks in volume group (xxxxx= volume name)木铎校园 BBS 社区[{~/E)lpdJ
  more -reads files and displays the text one screen at a time.木铎校园 BBS 社区%|*d-n8n\P
  mpcfg -df -list all setting the machine is set to (smp)
"Q!SZ+z*Qbf!K0  mpcfg -cf 11 1 -changes to fast IPL on SMP machines (smp)木铎校园 BBS 社区S]!~ Y c&U wM4gL;U
  mv fn (path fn) -move and rename a file木铎校园 BBS 社区B7V8N1FE k%B/w#kd6@
  oslevel -shows AIX version (3.2.4 and above)木铎校园 BBS 社区 MetP^ S2{2?l}
  pg -reads and displays text one screen at a time.
hMP6E1t;S0  pdisable -makes unavailable or shows all disabled tty's
C IX9[#y0  pdisable tty# -disables a tty
]2??:S+am m0  penable -makes available or shows all enabled tty's木铎校园 BBS 社区Cg4V7C3E(q }3B
  penable tty# -enables a tty木铎校园 BBS 社区;^DIj'}2k*~^jRG"u
  ps -el |pg -look at process running on system木铎校园 BBS 社区W6`G}J\"?.O/k @0I
  pwd -list what DIR you are currently in木铎校园 BBS 社区T%Yi|.uO
  r -repeats last command木铎校园 BBS 社区+ppMj8a+H$SLHK
  rm -i ******* -remove a file & will prompt you if you are sure木铎校园 BBS 社区k[| {4jV Q:v4E;c/D
  rmdev -l XXXXX -removes a device and defines it to data base木铎校园 BBS 社区NJV|}qr5RM
  rmdev -l XXXXX -d -removes a device and deletes it from data base
2D _H(T;? XE!T _C0  set -o vi -sets up to veiw cammands that have been run
s*t P(p'O,niEC0  :wq -write(save) and quit file木铎校园 BBS 社区 c3J$b S$l5Q
  Esc + k -used with SET command to list last command
0~g Tk2@0  k,l -k=list next command ran, l=steps you thru command木铎校园 BBS 社区2Q6^0Z[0b
  I -use with SET command inserts characters
}E.HVRW u0  j -steps you backwards
#A(z9a%a1c es0OH0  cw -cw=removes a word,just type in new word
o0_cD2[:R!^y0  (use with Esc)木铎校园 BBS 社区7Uj V@rsj?
  a,x,r -a=added text, x=delete text, r=replace text(r+letter)
K$k6e)r {0  R -lets you type over letters or words木铎校园 BBS 社区$cn\%Li9?(S0t#}p
  smit ***** -(*****= tape,disk,tty,etc.fastpath)
$Z4A+pNu@"y0  su -stands for switch user,(NOT super user)
qy:v@^oJ NX @0  su -switches to root id or prompts you for password木铎校园 BBS 社区\;j o tBjsB!f
  su XXXXXX -switches to XXXXXX's id
6kfHM-P \/T(u%H0  tar -cvf /dev/rmtX /etc -will copy /etc to a tape drive
3zA5mD9Th? q0  tar -tvf /dev/rmtX -will read a tape drive木铎校园 BBS 社区E'd0G3Hbx
  tctl -f /dev/rmtX rewoffl -rewind & eject tape木铎校园 BBS 社区%vg+_$?4o,l|.jZ.g
  tctl -f /dev/rmtX.1 fsf 3 -forward advances a tape to be read by TAR
/Nf.c-ZP%~&nS0  tctl -F -list avail commands(-F flag is not correct)
9fl7}3w uBeOPe k0  tctl retension -retensions tape in tape drive木铎校园 BBS 社区 @2[:X^O!XY0?
  & -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 :( :)

关于作者