paperlined.org
apps > aix
document updated 14 years ago, on Jan 20, 2010
This is a reformatted / cleaned-up version of this FAQ.

AIX commands

Posted: 5 Jan 2004 (Edited 10 Mar 2004) (Reformatted 20 Jan 2010)

1. Useful commands

Note All AIX commands reference can be found under
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.cmds/doc/aixcmds1/ac.htm

1.1 Memory

bootinfo -rshows how much RAM does my machine have (as root)
lsattr -E -l sys0 -a realmem shows how much RAM does my machine have (as non root)
rmss -c 512sets the memory size to 512 MB
rmss -rresets the memory size to the original one

1.2 Devices

lsattr -El en0displays en0 driver params
lsattr -El ent0displays ent0 HW params
lsattr -El rmt0displays tape params
lscfg -vp -l rmt0(all information about a tape drive)
lsattr -El sys0displays system type, firmware, etc driver params
lscfg -vlists all system HW config (NVRAM)
lsdev -Csscsilist all scsi devices
lsdev -Cspcilist all pci devices
lsparent -Ck scsilist all scsi adapters
lsdevfclist fiberchannel devices
cfgmgrConfigures devices
lsdev -CcdiskShows all disks
lsdev -CctapeShows all tapes
cfgmgr -v -l device -vSpecifies verbose output. The cfgmgr command writes information about what it is doing to standard output.
cfgmgr -v -l deviceName Specifies the named device to configure along with its children.
If you only turned on a disk tower at e.g. scsi2 cfgmgr -v -l scsi2 will only configure this with detailed output.
lsdispTo check which graphic adapter is installed.
lscfg -vp -l mga0(all information about a adapter)
lscfg -vp -l hdisk0 | grep Machinegives info about the disk manufacture type
lsslot -c pciFor 6F1 only !!!! Lists all slots ,voltage,boards,etc !!!!
bootlist -m normal cd0 rmt0 hdisk0Changes the default bootlist
lsmcode -cdisplay the system firmware level and service processor
lsmcode -r -d scraid0display the adapter microcode levels for a RAID adapter scraid0
lsmcode -Adisplay the microcode level for all supported devices

1.3 System info

/usr/bin/uname -mGet machine ID
/usr/bin/uname -MGet platform type
oslevelDisplays current AIX level
oslevel -rDisplays current AIX maintenance level
oslevel -gList filesets at levels later than maintenance level !!!
lsps -aPaging space settings.
lscfg -vp -l proc0 (1,2,3)(all information about a processor[s])
lscfg -vp -l mem0 |pg(all information about memory modules installed)
env ulimitEnvironment setings - show user ulimit
bootinfo -s hdisk0Displays disk size
lsattr -El sys0 -a systemidDetermines the system serial number
lscfg -vp|grep ROM|grep -v CDDetermines the system Firmware level

1.4 System issues

TERM=vt100If you execute a command/application and it responds with msg ‘ The type of your terminal is unknown to the system’,run those commands
rcp -rp /dataVolumes/brisque1.1.0/jobs/flower.job sciroot@ripro3:/dataVolumes/ripro3.3.0/jobs/-Copying a file from one Unix machine (Brisque) to another (Server) the assumption is that both machines know each other’s names (in hosts file)
dd if=/dev/fd0 of=/temp/diskimage bs=4096-Duplicate a diskette copy from diskette to hard drive
dd if=/temp/diskimage of=/dev/fd0 bs=4096-copy diskette image onto diskette
/usr/lpp/X11/bin/xset -display unix 0 s off-Kill display timeout
lsfs -v jfs-List of Filesystem items.
lsfs -q -v jfs-you can see also the parameter of a filesystem and thus see if e.g. /backup was or is a big_filesystem_enabled one.
Important for the 2GB File limit.
lsuser -f rootShows all user parameters (max .file size,etc)
sysdumpdev -LCheck last system dump status
sysdumpdev -lCheck system dump device settings
lslpp -f Upd_Timna_DTM.objList contents of the package

1.5 Networking

#!ksh
for ENT in ` lsdev -Cs pci|grep ent | awk '{ print $1 }'|cut -c 1,2,4 `;do
  mktcpip -S $ENT
done
exit-Shows all interfaces IP config+mask+router+DNS !
host timna1displays station default IP address - works ONLY in DNS environment
ifconfig en0displays en0 driver params
netstat -idisplays network interfaces setting
mktcpip -S en0#host:addr:mask:_rawname:nameserv:domain:gateway:type:start
syslab18:192.9.100.1:255.255.255.0:en0:10.4.2.12:csil.creoscitex.com:10.4.30.1:N/A:no
GREAT TCPIP info in one command !!!
showmount -edisplays all exported volumes
showmount -ashow who's got my filesystemsses mounted over IP !
lssrc -g tcpipdisplays all IP oriented processes status
entstat -drt ent0 |grep -i errordisplay any communication errors on etn0
entstat -rResets all the statistics back to their initial values.
arp -ashows a local arp cache
cd /usr/local/es/;resrestarts appletalk
netstat -ptcpshows IP statistics
netstat -pudpshows UDP statistics
netstat -c
-s
-m client only;
server only
NFS mount
netstat -I en0 10Trace en0 every 10 seconds
netstat -rnDisplay routing info with IP address (10.4.27.182)
netstat -inShows the state of all configured interfaces
netstat -rDisplay routing info with full hostnames (timna2.csil.creoscitex)
nfsstat -z ;to reset NFS stats without reboot
cat /etc/resolv.confCheck DNS settings
stopsrc -g NFSTo stop NFS services on a client
startsrc -g NFSTo start NFS services on a client
traceroute 149.115.39.1Trace all hobs (interconnections=routers) to the destination IP
netpmon -o netpmon.out
trcstopTraces all network processes activity into a logfile. Must be preceede by a trcstop command !
nslookup hostnameShows the DNS server name and address
ping -R -c 1 bnc2Ping with displaying the routing info
namerslv -s | grep domain | awk '{ print $2 }'Displays a fully qualified domain name of a host
rupShows the status of a remote host on the local network
nmonnfsTraces all NFS processes activity
mount hostname:/filesystem /mount-pointMount an NFS filesystem
mknfsexp -d /directoryCreates an NFS export directory
mknfsmntCreates an NFS mount directory
rmnfsStops and un-configures NFS services
mknfsConfigures and starts NFS services
exportfs -u (filesystem)Un-exports a filesystem
exportfsLists all exported filesystems
exportfs -aExports all fs's in /etc/exports file

1.6 Disks

synclvodm -vP svg3synchronizes ODM and the disk VG info.
redefinevg svg3Redfined VG definition in ODM
lqueryvg -p hdisk0 -Avt-reads logical volumes info from disk
bootinfo -s hdiskxShows Megabytes available even if no volume group is assigned.
lspv -p hdiskx(PP's used, location on disk, mount point)
lscfg -vp -l hdiskx(all information about a disk/raid)

1.7 Filesystem

chfs -a size=+200000 /varincreases /var FS by 100MB
du -sk /johnshows directory used space in kb !!!!
mount allmounts all FS
umount /dataVolumes/rtest9.1.0unmounts a FS
fuser -k /dev/cd0Releases a CD that will not unmount !
fuser -c /dataVolumes/rtest9.1.0-Find out which process_id lock the FS
istat <filename>Shows when the file was last created/modified/accessed !!!!

1.8 System monitoring

istat <filename>Shows create/modify/access file info
alog -o -t boot | moredisplays system boot log
wLists login users and their programs.
whoIdentifies the users currently logged in
/usr/local/es/swhoIdentifies the Ethershare users currently logged in
last |moreshows last logins
last -20Shows recent 20 lines
last rootShows username ‘root’ login/logout record
last ftpShows all FTP session in the record
mountshows all mounted filesystems (nfs+local)
ps -efshow all running processes
ps -ef |grep Scitexshow all scitex running processes
du -ak /scitex|sort -n -r|head -10-Display 10 biggest directories on the volume by size
find /scitex -xdev -size +2048 -ls|sort -rn +6|head -10-to find 10 top files in the root (/) directory larger than 1 MB.”-xdev” helps searching ONLY in “/” !!!!!!!!!
historyLast commands run on the system by this user
alog -ot bootLists a log of all boot operations
grep TX /etc/environmentVerify daylight settings

1.9 Performance issues

nmona nice monitor - runs only on AIX5 and up
topasa nice monitor - runs only on AIX 4.3.3 and up
monitor -top 10 -s 2monitors system 10 top processes with 2 seconds
iostat 2displays disks activity every 2 seconds refresh interval
iostat -a 2AIX5 ONLY !!!!
displays disks and ADAPTER !!!! activity every 2 seconds refresh interval
vmstat 2;monitors virtual memory statistics every 2 seconds (see appendix A)
sar -P ALL 2 2Show all CPU’s activity on an SMP machine
svmon -i 2Monitors real and virtual memory
ps auxw | sort -r +3 |head -10-Shows top 10 memory usage by process
ps auxw | sort -r +2 |head -10-Shows top 10 CPU usage by process
ps -auw | grep defunctShows zombies processes (to kill - reboot or kill the parent)
filemon -O all -o filemon.out ; find / -name core ; trcstopTraces FS,LV,disks,files activityof a “find” command into a logfile (filemon.out). Must be preceded by a trcstop command.
tprof -x find / -name core ; trcstopTraces CPU activityof a “find” command Severall logfile are created. Must be preceded by a trcstop command.
tprof -ske -x "sleep 30"-Trace CPU activity for next 30 seconds.Results in file sleep.tprof
lvmstat -ev svg1
lvmstat -v svg1 2AIX5 ONLY !!!!
enable gathering the VG statistics
Display VG logical volumes statistics every 2 seconds

1.10 Remote issues (working over the modem)

pdelay tty0; pdisable tty0 >/dev/null ;penable tty0-Resets tty0
stty erase '^?'Makes bakespace work
/scitex/version/utils/modem/kermit -l /dev/ttyx -c atdt {phone #}Use Unix to Dail-out (for any reason) ttyx is the serial port the cable is connected
/scitex/version/utils/modem/kermit -s /u/d0/ripro_messages -iSends a file to a remote desktop in binary mode
/scitex/version/utils/modem/kermit -r-Receives a file to from remote desktop

1.11 Browsing errlog with errpt

errpt -a -s 0604090601 -e 0605090901browse the errlog in detail for all errors within a timeframe
errpt -a -N SYSPROC |more
errpt -a -N SYSPROC > /tmp/err.logBrowse the errlog for the SYSPROC resource, can be into the file
errpt -j 5DFED6F1-Browse the errlog by the identifier
errpt -A-AIX5 ONLY !!!! Shows less detailes then errpt -a
errpt -D-AIX5 ONLY !!!! eliminates double entries

1.12 Security issues

chmod -s FilenameRemove Sticky bit from a file or directory
chmod +r+w+x+t FilenameAdd Read+Write+Execute+Temp mode to a file or directory.
This is a ‘blanket’ change for all owner, user & group.
Numeric Access Modes
0 (---)- no access
1 (--x)- execute permissions; search permissions for directories
2 (-w-)- write access
3 (-wx)- execute/search permission and write access
4 (r--)- read access
5 (r-x)- execute/search permission and read access
6 (rw-)- read and write access
7 (rwx)- execute/search permission and read and write access
mkpasswd -frebuild the /etc/passwd indexes in case of suspected corruption

1.13 Miscellaneous

grep -ris "10\.4\.27\.181" 2>/dev/null -Find all files containing my IP address
compress -c file > file.ZCompresses the files while keeps the original
whereis <command-name>Returms full path of program