AIX 常用命令大全
资料简介:
AIX命令大全,更多命令在2楼附件。史上最全的命令集合,管理员必备,随时查阅。
命令不是概念,不一定要详细的记住其参数。最重要的,是知道有这个命令,有这个功能。
赞同的,就顶起吧!!
LD_LIBRARY_PATH is LIBPATH for AIX
Print a stanza
# Here we look in /etc/security/user file and print root's stanza
# finds line starting with root: and ends on first blank line
awk '/^root:/,/^$/' /etc/security/user
Make a filesystem:
mkvg -f -B -y new-vg hdiskx hdisky ...
mklv -y mylv -t jfs2 rootvg 30M
crfs -v jfs2 -d(lv) -m(mount point) -A yes
chlv -x 1024 lv05
To determine the AIX version and maintenance level
uname -a
more /usr/lpp/bos/README
oslevel -r
oslevel -q
oslevel -g
oslevel -l 5.2.0.0 #list filesets needing updates
oslevel -rl 5200-05 #what is "wrong" with this release version
lslpp -L bos.mp #determine level of fileset X
lslpp -a -h bos.mp #determine history and level of fileset X
#determine what fileset a binary is part of
lslpp -w /usr/sbin/lsvpcfg
lslpp -w /usr/bin/java
lppchk -v #any probs w/ s/w?
To check the microcode level of the HBAs
lsdev -Cc adapter -spci
Loop on FC Adapters
lsmcode -cd
lsmcode -cd fcs0 ... fcs1
lscfg -vpl fcs0 ... fcs1
lscfg -vp | grep alterable
firmware
lsdev -C -Ftype,name | grep -i fcs
System Firmware
lscfg -vp | grep -p Plat
lscfg -vp | grep -p "System VPD" | grep "System Info Specific.(YL)"
No activity on HBA? Run advanced diags on HBA to "intialize it" in the OS.
model/uname/serial num
prtconf
prtconf | grep "Serial Number"
prtconf | grep "System Model"
uname -M
prtconf | grep "Model Architecture" || bootinfo -p
bootinfo -z 0=uniproc, 1=multiproc
lscfg
lsattr
lsdev
To check the versions of the device drivers
lslpp -l | grep -i powerpath
lslpp -l | grep -i hba
lslpp -l | grep "FC Software"
lslpp -L EMC.Symm* #should get two outputs - aix and fcp
lslpp -L devices.pci.df1000f*
To determine the device names for the HBA cards
lsdev -Cc adapter|grep fcs
To determine the part numbers for the HBAs
lscfg -vpl fcs0 | grep "Part Number"
List device module (like modinfo in solaris)
scls -l
List EMC Power devices
lsdev -C -t power
HSC/HMC/WSM/webSmit GUI
http://wsmnode/remote_client.html
http://wsmnode/remoteclient.html
http://wsmnode/wsm.html
/usr/websm/bin/wsm
/usr/bin/websm
websmit (hacmp) - http://HOSTNAME:42267
mkvterm -m cec1 -p lpar1
lssyscfg -r --all
lssyscfg -r lpar -F name,default_profile
lshsc -a
lshwres -r io
lparstat [-[l,H,i]]
lsrsrc IBM.ManagementServer| grep Hostname| grep -v Local
lsrsrc IBM.ManagementServer
uname -L
monitoring tools
topas -L
nmon
svmon
default password: admin/admin
baud (if no HMC, but local console on P5) use 19200 (not 9600)
solaris mkfile in aix is /usr/sbin/lmktemp file 100m example.
To switch from 32-bit mode to 64-bit mode run the following commands, in the given
order:
1.ln -sf /usr/lib/boot/unix_64 /unix
2.ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
3.bosboot -a
4.shutdown -Fr
5.bootinfo -K (should now show 64)
Documentation
no web
[url=file:///usr/share/man/info/en_US/a_doc_lib/aixgen/topnav.htm]file:///usr/share/man/info/en_US/a_doc_lib/aixgen/topnav.htm[/url]
web
http://$SERVERNAME/doc_link/en_US/a_doc_lib/aixgen/topnav/topnav.htm
infoexplorer: info -h $TOPIC
size of disk
lscfg -v | grep disk
bootinfo -s (disk device) reports size of disk drive
List volumes on hdisks by vg
lsvg -o | lsvg -i -l
List free space in vg
lsvg -pl $VG
oslevel [-r]
instfix -viq
instfix -viq | grep AIX | grep Update
swapon -a
isps -a
df -v
/etc/filesystem
/etc/vfs
mount
for VG $(lsvg)
do
lsvg -lv $VG
lsvg -p $VG
lsvg $VG
done
lsdev -Cc disk
lsdev -C -c adapter -F 'name class location physloc'
lsdev -C -c tty -F 'name class location physloc'
#SSA disk
ssaxlate -l hdisk3
pdisk2
#give h/w model and part number of a disk
lscfg -vl pdisk2
lscfg -pl pdisk2
lspv -l
lspv HDISK
lspv -p HDISK
lsvpcfg #list all disks and the vpaths
lsdev -Cc disk -s dpo -t vpath -F name
ls -l /etc/vg
ttyconf -l pcsim
lsdev -C -c tty -H
hostid exists, but use 'uname -m' - cpu-id
BOS: Basic OS
TMOUT=0
errpt == dmesg
setclock
oslevel == uname -v -r (swap x with y: 1 3 is 3.1)
tctl == mt ~= tapeutil
tapeutil -f /dev/rmt0 mount 49 #slot 49 to rmt0
tapeutil -f /dev/rmt0 umount 34 #from rmt0 to slot 34
tapeutil -f /dev/rmt0 inventory
/usr/sbin/sbdevice -vr rmt0 #rewind
/usr/sbin/sbdevice -ver rmt0 #rewind and eject
sbdevice -e /dev/rmt0
*OR* tcl -f /dev/rmt0 offline
*OR* tapeutil -f /dev/rmt0 unload
tcopy #does a tapedir and/or copy tape to tape
mkdev -c disk -s scsi -t osdisk -p scsi2 -a pv=yes
mkboot -c -d /dev/ # installboot on alternate disk
which_fileset CMD #needs bos.rte.install
istat #does inode status/info
/etc/filesystem == /etc/fstab
/etc/qconfig == /etc/printcap
mkps #add paging
chps #chg paging
rmps #rm paging
shutdown -m #maint or single user mode
enq == lpc
startsrc/stopsrc PRODUCT #rc scripts
bootinfo -K #32 or 64 bit kernel
bootinfo -r
OR
lsattr -E -l sys0 -F 'description value' -a 'realmem'
OR
lsattr -E -l sys0 -a realmem -F value
OR
lsattr -El mem0 #memory
lscfg -pv #list memory by slots (close to solaris prtdiag)
lsattr -l sys0 -E
odmget -q "name = sys0 and attribute = autorestart" CuAt
diag -a #add or remove devices from system kernel and prom
cfgmgr
cfgmgr -i /dev/cd0 #load drivers for any new devices found, from the CD
lscfg
lscfg -l mem*
lscfg -l mem* -v
lscfg -vpl ent0 #get MAC
lsattr -Cc [disk | tape]
lslv -m hd5 #see who is the primary mirror for a lv
NEW_DISK=hdisk1
lspv
#see if it has a hex dev id
# if not, do a
chdev -l $NEW_DISK -a pv=yes
extendvg -f rootvg $NEW_DISK
#use mklvcopy if you don't want all LVs to be mirrored
mirrorvg -S rootvg $NEW_DISK
# done by mirrorvg "syncvg -v rootvg"
bosboot -a -d /dev/$NEW_DISK
bootlist -m normal hdisk0 $NEW_DISK
#make a VG
# big vg -B so you can more than 32 disks in a VG
mkvg -f -B -y new-vg hdiskx hdisky ...
#list install software
lslpp -h all | grep -i vrts
#determine level of fileset X
lslpp -L bos.mp
#determine history and level of fileset X
lslpp -a -h bos.mp
#determine what fileset a binary is part of
lslpp -w /usr/sbin/lsvpcfg
lslpp -w /usr/bin/java
#Commit all installed s/w
installp -c -g -X all
#Install and commit all installed s/w
installp -acXd /tmp/Atape.x.x.x.bin Atape.driver
installp -acXd /tmp/atldd.x.x.x.bin atldd.driver
installp -a -Q -d . -c -N -g -X all
installp -a -Q -d /tmp/install -c -N -g -X all
#install a package
installp -qa -d . printers.msg.en_US
#install a specific package version
installp -qa -d . printers.msg.en_US 5.2.0.0
#install a package and automatically load any prerequisite packages
installp -qag -d . printers.msg.en_US
#install "latest" ML (maintenance level) in curent dir
/usr/lib/instl/sm_inst installp_cmd -a -Q -d /tmp/ml -f _all_latest -c
-N -g -X -G
#install "ALL" ML (maintenance level) in curent dir
/usr/lib/instl/sm_inst installp_cmd -a -d /tmp/ml -f _update_all -c
-N -g -X
#missing packages? (ML level doesn't show what you expect)
# instfix -i | grep ML | grep not
# instfix -ivk 4330-11_AIX_ML | grep : | grep not
installp -a -Q -d /tmp/ml-XX -c -N -g -X all
#compare two systems
lslpp -Lc > /tmp/server1.out
lslpp -Lc > /tmp/server2.out
compare_report -b /tmp/server1.out -o /tmp/server2.out -l -h -m -n
> compare_report.out
diag - run "Task Selection"
=> "Automatic Error Log Analysis and Notification"
=> "Add to the error notification mailing list"
to add email addresses for h/w failure notification
Patches
1. Issue lslpp -i
This outputs the Product ID information of the software installed
using the installp command on AIX.
2.Check with your AIX support personnel for the most up-to-date
list of fixes for each product.
3.Issue insfix -ik FIX_ID to verify that the FIX_ID fix has been
applied to your system.
#find something within a specific filesystem - dont't cross filesystem mounts
find /usr -xdev myfile #like -mount in solaris
# install s/w from file
#
# See if it is installed: instfix -ik IX79484
#
# Do a 'inutoc .' in directory first to build a .toc
#
#
cd /var/adm/patches/somedir
inutoc .
installp -a -d . -f .toc -c -g -X -v -V2
# EMC package
cd /mnt/EMC/ECC/Control_Center_5.2
./install_master.sh `pwd`
cd /mnt/EMC/PowerPath/PowerPath4.4/aix
installp -qa -d ./EMCpower_install EMCpower
cd /mnt/EMC/Drivers/AIX
installp -qa -d ./EMC.AIX.5.2.0.0 EMC.Symmetrix.aix.rte EMC.Symmetrix.fcp.rte
# ** UN-install software**
installp -u EMCpower
ALL
fuser `tty`
ps -t tty0p1 -f
ps -t console,ttyp1 -f
#get kernel threads too
ps -efk
dbm
*.dir - index file
*.pag - data file
useradd -c "Last, First" -d /home/usename -g 1 -m -u 12345 -s /usr/bin/ksh username
-------------------------------------------------
SMS Menu
when power on -
get 'keyboard' word on screen
press 1 to get
RS/6000 Firmware
Version WIL99308
(c) Copyright IBM Corp. 1997 All rights reserved.
--------------------------------------------------------------------
System Management Services
1 Display Configuration
2 Multiboot
3 Utilities
4 Select Language
press 5 to get
RS/6000 Firmware
Version WIL99308
(c) Copyright IBM Corp. 1997 All rights reserved.
--------------------------------------------------------------------
Multiboot
1 Select Software
2 Software Default
3 Install From
4 Select Boot Devices
5 OK Prompt
6 Multiboot Startup
-------------------------------------------------
NIM - lsnim -l CLIENT || lsnim -l | grep CLIENT
bootinfo -z 0=uniproc, 1=multiproc
lsnim -l CLIENT #status of install
nim -o reset -a force=yes 'myserv'
lsnim -c resources myserv
nim -F -o deallocate myserv
nim -F -o remove myserv
命令不是概念,不一定要详细的记住其参数。最重要的,是知道有这个命令,有这个功能。
赞同的,就顶起吧!!
LD_LIBRARY_PATH is LIBPATH for AIX
Print a stanza
# Here we look in /etc/security/user file and print root's stanza
# finds line starting with root: and ends on first blank line
awk '/^root:/,/^$/' /etc/security/user
Make a filesystem:
mkvg -f -B -y new-vg hdiskx hdisky ...
mklv -y mylv -t jfs2 rootvg 30M
crfs -v jfs2 -d(lv) -m(mount point) -A yes
chlv -x 1024 lv05
To determine the AIX version and maintenance level
uname -a
more /usr/lpp/bos/README
oslevel -r
oslevel -q
oslevel -g
oslevel -l 5.2.0.0 #list filesets needing updates
oslevel -rl 5200-05 #what is "wrong" with this release version
lslpp -L bos.mp #determine level of fileset X
lslpp -a -h bos.mp #determine history and level of fileset X
#determine what fileset a binary is part of
lslpp -w /usr/sbin/lsvpcfg
lslpp -w /usr/bin/java
lppchk -v #any probs w/ s/w?
To check the microcode level of the HBAs
lsdev -Cc adapter -spci
Loop on FC Adapters
lsmcode -cd
lsmcode -cd fcs0 ... fcs1
lscfg -vpl fcs0 ... fcs1
lscfg -vp | grep alterable
firmware
lsdev -C -Ftype,name | grep -i fcs
System Firmware
lscfg -vp | grep -p Plat
lscfg -vp | grep -p "System VPD" | grep "System Info Specific.(YL)"
No activity on HBA? Run advanced diags on HBA to "intialize it" in the OS.
model/uname/serial num
prtconf
prtconf | grep "Serial Number"
prtconf | grep "System Model"
uname -M
prtconf | grep "Model Architecture" || bootinfo -p
bootinfo -z 0=uniproc, 1=multiproc
lscfg
lsattr
lsdev
To check the versions of the device drivers
lslpp -l | grep -i powerpath
lslpp -l | grep -i hba
lslpp -l | grep "FC Software"
lslpp -L EMC.Symm* #should get two outputs - aix and fcp
lslpp -L devices.pci.df1000f*
To determine the device names for the HBA cards
lsdev -Cc adapter|grep fcs
To determine the part numbers for the HBAs
lscfg -vpl fcs0 | grep "Part Number"
List device module (like modinfo in solaris)
scls -l
List EMC Power devices
lsdev -C -t power
HSC/HMC/WSM/webSmit GUI
http://wsmnode/remote_client.html
http://wsmnode/remoteclient.html
http://wsmnode/wsm.html
/usr/websm/bin/wsm
/usr/bin/websm
websmit (hacmp) - http://HOSTNAME:42267
mkvterm -m cec1 -p lpar1
lssyscfg -r --all
lssyscfg -r lpar -F name,default_profile
lshsc -a
lshwres -r io
lparstat [-[l,H,i]]
lsrsrc IBM.ManagementServer| grep Hostname| grep -v Local
lsrsrc IBM.ManagementServer
uname -L
monitoring tools
topas -L
nmon
svmon
default password: admin/admin
baud (if no HMC, but local console on P5) use 19200 (not 9600)
solaris mkfile in aix is /usr/sbin/lmktemp file 100m example.
To switch from 32-bit mode to 64-bit mode run the following commands, in the given
order:
1.ln -sf /usr/lib/boot/unix_64 /unix
2.ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
3.bosboot -a
4.shutdown -Fr
5.bootinfo -K (should now show 64)
Documentation
no web
[url=file:///usr/share/man/info/en_US/a_doc_lib/aixgen/topnav.htm]file:///usr/share/man/info/en_US/a_doc_lib/aixgen/topnav.htm[/url]
web
http://$SERVERNAME/doc_link/en_US/a_doc_lib/aixgen/topnav/topnav.htm
infoexplorer: info -h $TOPIC
size of disk
lscfg -v | grep disk
bootinfo -s (disk device) reports size of disk drive
List volumes on hdisks by vg
lsvg -o | lsvg -i -l
List free space in vg
lsvg -pl $VG
oslevel [-r]
instfix -viq
instfix -viq | grep AIX | grep Update
swapon -a
isps -a
df -v
/etc/filesystem
/etc/vfs
mount
for VG $(lsvg)
do
lsvg -lv $VG
lsvg -p $VG
lsvg $VG
done
lsdev -Cc disk
lsdev -C -c adapter -F 'name class location physloc'
lsdev -C -c tty -F 'name class location physloc'
#SSA disk
ssaxlate -l hdisk3
pdisk2
#give h/w model and part number of a disk
lscfg -vl pdisk2
lscfg -pl pdisk2
lspv -l
lspv HDISK
lspv -p HDISK
lsvpcfg #list all disks and the vpaths
lsdev -Cc disk -s dpo -t vpath -F name
ls -l /etc/vg
ttyconf -l pcsim
lsdev -C -c tty -H
hostid exists, but use 'uname -m' - cpu-id
BOS: Basic OS
TMOUT=0
errpt == dmesg
setclock
oslevel == uname -v -r (swap x with y: 1 3 is 3.1)
tctl == mt ~= tapeutil
tapeutil -f /dev/rmt0 mount 49 #slot 49 to rmt0
tapeutil -f /dev/rmt0 umount 34 #from rmt0 to slot 34
tapeutil -f /dev/rmt0 inventory
/usr/sbin/sbdevice -vr rmt0 #rewind
/usr/sbin/sbdevice -ver rmt0 #rewind and eject
sbdevice -e /dev/rmt0
*OR* tcl -f /dev/rmt0 offline
*OR* tapeutil -f /dev/rmt0 unload
tcopy #does a tapedir and/or copy tape to tape
mkdev -c disk -s scsi -t osdisk -p scsi2 -a pv=yes
mkboot -c -d /dev/
which_fileset CMD #needs bos.rte.install
istat #does inode status/info
/etc/filesystem == /etc/fstab
/etc/qconfig == /etc/printcap
mkps #add paging
chps #chg paging
rmps #rm paging
shutdown -m #maint or single user mode
enq == lpc
startsrc/stopsrc PRODUCT #rc scripts
bootinfo -K #32 or 64 bit kernel
bootinfo -r
OR
lsattr -E -l sys0 -F 'description value' -a 'realmem'
OR
lsattr -E -l sys0 -a realmem -F value
OR
lsattr -El mem0 #memory
lscfg -pv #list memory by slots (close to solaris prtdiag)
lsattr -l sys0 -E
odmget -q "name = sys0 and attribute = autorestart" CuAt
diag -a #add or remove devices from system kernel and prom
cfgmgr
cfgmgr -i /dev/cd0 #load drivers for any new devices found, from the CD
lscfg
lscfg -l mem*
lscfg -l mem* -v
lscfg -vpl ent0 #get MAC
lsattr -Cc [disk | tape]
lslv -m hd5 #see who is the primary mirror for a lv
NEW_DISK=hdisk1
lspv
#see if it has a hex dev id
# if not, do a
chdev -l $NEW_DISK -a pv=yes
extendvg -f rootvg $NEW_DISK
#use mklvcopy if you don't want all LVs to be mirrored
mirrorvg -S rootvg $NEW_DISK
# done by mirrorvg "syncvg -v rootvg"
bosboot -a -d /dev/$NEW_DISK
bootlist -m normal hdisk0 $NEW_DISK
#make a VG
# big vg -B so you can more than 32 disks in a VG
mkvg -f -B -y new-vg hdiskx hdisky ...
#list install software
lslpp -h all | grep -i vrts
#determine level of fileset X
lslpp -L bos.mp
#determine history and level of fileset X
lslpp -a -h bos.mp
#determine what fileset a binary is part of
lslpp -w /usr/sbin/lsvpcfg
lslpp -w /usr/bin/java
#Commit all installed s/w
installp -c -g -X all
#Install and commit all installed s/w
installp -acXd /tmp/Atape.x.x.x.bin Atape.driver
installp -acXd /tmp/atldd.x.x.x.bin atldd.driver
installp -a -Q -d . -c -N -g -X all
installp -a -Q -d /tmp/install -c -N -g -X all
#install a package
installp -qa -d . printers.msg.en_US
#install a specific package version
installp -qa -d . printers.msg.en_US 5.2.0.0
#install a package and automatically load any prerequisite packages
installp -qag -d . printers.msg.en_US
#install "latest" ML (maintenance level) in curent dir
/usr/lib/instl/sm_inst installp_cmd -a -Q -d /tmp/ml -f _all_latest -c
-N -g -X -G
#install "ALL" ML (maintenance level) in curent dir
/usr/lib/instl/sm_inst installp_cmd -a -d /tmp/ml -f _update_all -c
-N -g -X
#missing packages? (ML level doesn't show what you expect)
# instfix -i | grep ML | grep not
# instfix -ivk 4330-11_AIX_ML | grep : | grep not
installp -a -Q -d /tmp/ml-XX -c -N -g -X all
#compare two systems
lslpp -Lc > /tmp/server1.out
lslpp -Lc > /tmp/server2.out
compare_report -b /tmp/server1.out -o /tmp/server2.out -l -h -m -n
> compare_report.out
diag - run "Task Selection"
=> "Automatic Error Log Analysis and Notification"
=> "Add to the error notification mailing list"
to add email addresses for h/w failure notification
Patches
1. Issue lslpp -i
This outputs the Product ID information of the software installed
using the installp command on AIX.
2.Check with your AIX support personnel for the most up-to-date
list of fixes for each product.
3.Issue insfix -ik FIX_ID to verify that the FIX_ID fix has been
applied to your system.
#find something within a specific filesystem - dont't cross filesystem mounts
find /usr -xdev myfile #like -mount in solaris
# install s/w from file
#
# See if it is installed: instfix -ik IX79484
#
# Do a 'inutoc .' in directory first to build a .toc
#
#
cd /var/adm/patches/somedir
inutoc .
installp -a -d . -f .toc -c -g -X -v -V2
# EMC package
cd /mnt/EMC/ECC/Control_Center_5.2
./install_master.sh `pwd`
cd /mnt/EMC/PowerPath/PowerPath4.4/aix
installp -qa -d ./EMCpower_install EMCpower
cd /mnt/EMC/Drivers/AIX
installp -qa -d ./EMC.AIX.5.2.0.0 EMC.Symmetrix.aix.rte EMC.Symmetrix.fcp.rte
# ** UN-install software**
installp -u EMCpower
ALL
fuser `tty`
ps -t tty0p1 -f
ps -t console,ttyp1 -f
#get kernel threads too
ps -efk
dbm
*.dir - index file
*.pag - data file
useradd -c "Last, First" -d /home/usename -g 1 -m -u 12345 -s /usr/bin/ksh username
-------------------------------------------------
SMS Menu
when power on -
get 'keyboard' word on screen
press 1 to get
RS/6000 Firmware
Version WIL99308
(c) Copyright IBM Corp. 1997 All rights reserved.
--------------------------------------------------------------------
System Management Services
1 Display Configuration
2 Multiboot
3 Utilities
4 Select Language
press 5 to get
RS/6000 Firmware
Version WIL99308
(c) Copyright IBM Corp. 1997 All rights reserved.
--------------------------------------------------------------------
Multiboot
1 Select Software
2 Software Default
3 Install From
4 Select Boot Devices
5 OK Prompt
6 Multiboot Startup
-------------------------------------------------
NIM - lsnim -l CLIENT || lsnim -l | grep CLIENT
bootinfo -z 0=uniproc, 1=multiproc
lsnim -l CLIENT #status of install
nim -o reset -a force=yes 'myserv'
lsnim -c resources myserv
nim -F -o deallocate myserv
nim -F -o remove myserv
2013-12-02
浏览10541
下载0