当前位置:文档之家› 常用的系统状态查询命令

常用的系统状态查询命令

常用的系统状态查询命令# lsdev –C –s scsi列出各个SCSI设备的所有相关信息:如逻辑单元号,硬件地址及设备文件名等。

# ps -ef列出正在运行的所有进程的各种信息:如进程号及进程名等。

ps aux查看进程信息# netstat -rn列出网卡状态及路由信息等。

# netstat -in列出网卡状态及网络配置信息。

# df -k列出已加载的逻辑卷及其大小信息。

#top查看系统应用信息,如CPU、内存使用率。

按u,输入用户名则可监视用户;按k然后输入特定进程PID可关闭此进程,输入信号代码15关闭进程,输入信号代码9强行关闭。

# mount列出已加载的逻辑卷及其加载位置。

# ntsysv选择启动服务# 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 查看路由表附:常用命令列表:Any XXXX, ####, ****, or X is to be substituted by a name, resource name or #,fn = filenameDIR = Directory| = pipe symbolbosboot -a -d /dev/hdiskx -rebuilds boot record/image on boot device(hdiskx)cat -view contents of a filecat /tmp/****.1 -view a file, look at outputcat fn fn > newfile -combines two files to a single filecd -will return you to default DIRcd / -will put in root DIRcd /xxxx -change you to a DIR anywhere is systemcd .. -will drop you out of 1 DIR at a timecd xxxxx -will change you to a DIR in current dircfgmgr -will auto config devicescfgmgr -v & -(-v) shows processes (&) puts in backgroundchps -s xx hd# -increase paging space (xx=# of addt'l PPs)cp oldfn newfn -copy a filecp oldfn Dirn -copy a file to another directorycrontab -l -list crontab entries for the current userctrl + v -will page down 1 pagectrl + 6 -will page up 1 pagedel fn -same as rm -i,promts to remove fndf -I -shows status of file systems (no inodes)df -Ik -(k) show status in 1024 bites(1mb)(only AIX 4diag -a -updates changes in hardware configurationdiag ***** -****= a device type(as tape,disk....Fastpath)diag -cd rmtX -resets tape drivedosformat -formats a diskette to DOSdosdir -list files on dos formated diskettedosread XX YY -copies dos file XX to aix file YYdoswrite YY XX -copies aix file YY to dos file XXerrpt -generates a one line synopsis of logged errorserrpt | pg -list errorlog 1 page @ a time(1st column is ID)errpt -a -displays detailed information of logged errorserrpt -s Mmddhhmmyy -select entries posted later than dateerrpt -aj XXXXXXX -list detail error by ID number.(XXX=1st column) errpt -d S -list software errorserrpt -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 errorlogerrclear -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 detailsflcopy -copies a diskette to another disketteformat -formats a diskette in default diskette driveformat -l -formats in lower denity: 1.44 on 2.44 / 720 on 1.44 hostname -responds with host system namehost (hostname) -responds with internet addressinstfix -ik IPAR# -lists ipar fix was completely installedlppchk -v -checks install status of LPPslppchk -v 2> /dev/lpX -sends output of lppchk to printer lpx lpstat -a all -view all printer queueslptest 80 5 > /dev/lp0 -send test pattern to lp0ls -list names of files & directories in current dirls -lia -list details of files, current dir & subdirls -al -list details of files or dir in current dirlsattr -El xxxxxx -list specific settings on a devicelsdev -C | sort -d -f -list system hardware (devices)lsdev -C | grep 00-0X -list resourses for a adapterlsdev -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 deviceslsdev -Cs pci -list pci deviceslsdev -Cs isa -list isa deviceslscons -lists the assigned consolelscfg -list hardware list (same as diags list)lscfg -rl mem* |pg -lists the memory on PCI bus machineslscfg -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" cmdlslpp -l | grep BROKEN -lists incomplete ptfslslv -m hd5 -finds boot drive under pv1 columnlsps -a -checks available paging spacelsps -s -checks available paging spacelspv -lists information about the physical volumeslspv hdisk# -list drive infolspv -l hdisk# -lists logical volume group disk inlsuser -f ALL -lists all attributes for all userslsvg -lists volume groupslsvg -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 fileoslevel -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'spdisable tty# -disables a ttypenable -makes available or shows all enabled tty'spenable tty# -enables a ttyps -el |pg -look at process running on systempwd -list what DIR you are currently inr -repeats last commandrm -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 fileEsc + k -used with SET command to list last commandk,l -k=list next command ran, l=steps you thru commandI -use with SET command inserts charactersj -steps you backwardscw -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 wordssmit ***** -(*****= tape,disk,tty,etc.fastpath)su -stands for switch user,(NOT super user)su -switches to root id or prompts you for passwordsu XXXXXX -switches to XXXXXX's idtar -cvf /dev/rmtX /etc -will copy /etc to a tape drivetar -tvf /dev/rmtX -will read a tape drivetctl -f /dev/rmtX rewoffl -rewind & eject tapetctl -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<。

相关主题