other
Displays the contents of an executable
string information
object file headers
line numbers
the text section
Create a snapshot onto tape
Create a snapshot into a named directory
than the default (/tmp/ibmsupt)
/usr/dt/bin/dtconfig -d
/usr/dt/bin/dtconfig -e
/var/dt/Xpid
Disables desktop logins
Enables desktop logins
PID of the dtlogin process
nroff -man bas.1 | more
For reading man page format files (bas.1)
snap -gc
info)
snap -r
creates snap.tar.Z file in /tmp/ibmsupt (system config
removes old snap data
------------------------------------------------------------------------------LI
CENSES / SOFTWARE INSTALLATION
------------------------------------------------------------------------------ls
license
chlicense -u (number)
( ftp,rexec and rsh (without
be
able to access the system.
Displays number of current user licenses
Changes the number of user licenses
-i flag) do not need an AIX user license to
)
oslevel
Returns operating system level
4 . 3 . 3 . 0 <--------- Preventive Maintenance Level
|
|
|
|
|
+----------------Modification
|
+--------------------Release
+------------------------Version
oslevel -l 4.3.3.0
Displays all filesets that are "downlevel"
whence (program)
whereis (program)
Returns full path of program
Returms full path of program
what (program)
executable
Displays identifying info from the
like version number, when compiled.
lslpp
lslpp
lslpp
lslpp
lslpp
-L all
-L (program set name)
-f
-ha
-w /usr/bin/swapon
lppchk -c
lppchk -l
list all installed software
Check if software installed
Lists filesets vs packages
Lists installation history of filesets
Lists the fileset that the file belongs to
Checks file checksums against SWVPD
Checks symbolic links against SWVPD
instfix -ik (fix number eg IX66617)
instfix -ik 4330-02_AIX_ML
instfix -i | grep ML
Checks id fix is installed
instfix -k IX38794 -d /dev/cd0
Installs a fix from cdrom
/usr/sbin/install_assist
Smitty Installation Assistant
/usr/sys/inst.images/sys.bundles
Software bundle files
alt_disk_install -c hdisk1
alt_disk_install -w
Displays all ML's installed
Clones a running rootvg onto hdisk1
Wakes up alt vg
alt_disk_install -s
alt_disk_install -x
Sends alt vg to sleep !
Removes alt vg from disk
/usr/lpp/bosinst/blvset -d /dev/hdisk0 -p 4.2
Resets the pad string in the BLV to the correct AIX version. Needed if
the
migration option is missing when installing.
installp
fileset
installp
installp
installp
-ad (device) (fileset) (level)
Install apply and commit
-pad (device) (fileset) (level)
-u (fileset)
-ld (device)
Preview install
Remove fileset
List all software on device
example:installp -pad /dev/rmt0 X11.base 4.3.3.0
installp -C
installation.
Cleans up after a premature cancel or interrupted
------------------------------------------------------------------------------TE
RMINALS / DISPLAYS
------------------------------------------------------------------------------/u
sr/share/lib/terminfo
files.
Directory with all support terminal info
tty
Displays what the tty/pty number of the terminal is.
termdef
reports the termtype setup in smit for the tty port
that termdef is run on.
chdev -l (device eg tty1) -a term=vt100
type
penable tty0
getty
pdisable tty0
Sets tty to a vt100 terminal
adds getty line into /etc/inittab for tty0 and starts
for i in 0 1 2 3 4 5 6 7
do
mkdev -c tty1 -t tty -s rs232 -p sa2 -w$i -a login=enable -a
term=vt100
done
portmir -t /dev/tty0
portmir -o
sysline
Mirror current terminal onto /dev/tty0
Turns off port mirroring
Displays system status on a terminal's status line
------------------------------------------------------------------------------NE
TWORK
------------------------------------------------------------------------------ho
st (ip or hostname)
Resolves a hostname / ip address
hostname
hostname (hostname)
Displays hostname
Sets the hostname until next reboot
lsdev -Cc if
interfaces
Lists all available/defined network
chdev -l (device name) -a hostname=(hostname)
permanently
chdev -l inet0 -a hostname=thomas
ifconfig
ifconfig
chdev -l
ifconfig
ifconfig
(device
(device
(device
(device
(device
name)
name)
name)
name)
name)
Changes hostname
Displays network card settings
Turns on network card
Turns on network card
Turns off network card
Removes the network card from the
exportfs -a
Exports all fs's in /etc/exports file
exportfs -u (filesystem)
Un-exports a filesystem
mknfs
Configures and starts NFS services
rmnfs
Stops and un-configures NFS services
mknfsexp -d /directory
Creates an NFS export directory
mknfsmnt
Creates an NFS mount directory
mount hostname:/filesystem /mount-point
Mount an NFS filesystem
nfso -a
nfso -o option=value
nfso -o nfs_use_reserved_port=1
Display NFS Options
Set an NFS Option
------------------------------------------------------------------------------BA
CKUPS
------------------------------------------------------------------------------MK
SYSB (Uses AIX backup command)
-----mkszfile -f
mkszfile -X
Creates /image.data file (4.x onwards)
Creates /fs.size file
(3.x)
mksysb -i (device of file)
Creates a mksysb image
mksysb does not save any raw data and will not backup a filesystem that
is not mounted.
SAVEVG (Uses AIX backup command)
-----savevg -if (device or file) (vg)
Creates a savevg image
restvg -q -f (device or file)
Restore from a savevg image
Ensure that the restvg command is run
from /
mkvgdata (vg)
Creates new vgname.data file
CPIO ARCHIVE (Cannot handle files greater than 2 Gig)
-----------find (filesystem) -print | cpio -ocv > (filename or device)
eg find ./usr/ -print | cpio -ocv > /dev/rmt0
CPIO RESTORE
-----------cpio -ict < (filename or device) | more
Lists archive
cpio -icdv < (filename or device)
cpio -icdv < (filename or device) ("files or directories to restore")
eg cpio -icdv < /dev/rmt0 "tcpip/*"
contents
cpio -icdv < /dev/rmt0 "*resolve.conf"
Restore directory and
Restore a named file
TAR ARCHIVE (Cannot handle files greater than 2 Gig)
----------tar -cvf (filename or device) ("files or directories to archive")
eg tar -cvf /dev/rmt0 "/usr/*"
TAR RESTORE
-----------
bootinfo -k
reports keyswitch position
1=secure, 2=service, 3=normal
bootinfo -r
bootinfo -s (disk device)
bootinfo -T
reports amount of memory (/ by 1024)
reports size of disk drive
reports type of machine
ie rspc,rs6ksmp,rspc or chrp
lsattr -El sys0 -a realmem
reports amount of useable memory
mknod (device) c (major no) (minor no)
file.
mknod /dev/null1 c 2 3
Creates a /dev/ device
lsdev -C
lists all customised devices ie installed
lsdev -P
lists all pre-defined devices ie supported
lsdev -(C or P) -c (class) -t (type) -s (subtype)
chdev -l (device) -a (attribute)=(new value)
attribute
chdev -l sys0 -a maxuproc=80
lsattr -EH -l (device) -D
db
lsattr -EH -l sys0 -a modelname
Change a device
Lists the defaults in the pre-defined
rmdev -l (device)
defined
rmdev -l (device) -d
rmdev -l (device) -SR
Change device state from available to
lsresource -l (device)
Displays bus resource attributes of a device.
cfgmgr
cfgmgr -i /dev/cd0
/dev/cd0
Configures devices
Configure devices and install drivers from
cfgmgr -S
disks
cfgmgr -l scsi0
Delete the device
S stops device, R unconfigures child devices
if required
Run in serial, used with a larger number of
Configure devices on adapter scsi0 only
diag
Run hardware diagnostic menu
smitty diag
Run hardware diagnostic menu
( 7020-40P and 7248-43P machines cannot run diagnostics, use diagnostics
in the SMS menus instead )
diag -d (device)
lsslot
lsslot -c pci
lsslot -c pci -a
Run diagnostics against a device.
Displays all hot swap slots
Lists all pci hot swap slots
Lists all available pci hot swap slots
drslot
drslot -i -c pci -s U0.1-P1-I3
next to
identified.
Reconfgiures PCI hot-plug slots
Display a slot, flashes the LED
the slot so that it can be
lsvirprt
attributes.
Lists/changes virtual printer
lsallq
Displays all queues
rmvirprt -q queuename -d queuedevice
Removes a virtual printer
qpri -#(job No) -a(new priority)
Change a queue job priority.
qhld -#(job No)
qhld -r #(job No)
Put a hold on hold
Release a held job
qchk -A
lpstat
lpstat -p(queue)
lpstat -w
names)
Status of jobs in queues
qcan -x (job No)
cancel (job No)
Cancel a job from a queue
enq -U -P(queue)
enable (queue)
Enable a queue
enq -D -P(queue)
disable (queue)
Disable a queue
qmov -m(new queue) -#(job No)
Move a job to another queue
startsrc -s qdaemon
lssrc -s qdaemon
stop -s qdaemon
Start qdaemon sub-system
List status of qdaemon sub-system
Stop qdaemon sub-system
enscript
enscript
queue
enscript
queue
enscript
8
(filename)
-d(queue) (filename)
Prints ascii file to a postscript queue
Prints ascii file to a named postcript
-r (filename)
Prints ascii file in landscape to ps
Status of jobs in a named queue
Wide lpstat display (for long queue
-fCourier8 (filename) Prints ascii file using Courier font size
------------------------------------------------------------------------------FI
LE SYSTEMS
------------------------------------------------------------------------------Ph
ysical Volumes (PV's)
----------------------lspv
lspv (pv)
lspv -l (pv)
volume
lspv -p (pv)
PV
lspv -M (pv)
Lists
Lists
Lists
Lists
Lists
all
the
the
the
the
If the PV state is "missing" but the disk is okay, use "varyonvg vg" to
change
the state of the PV to "active".
chdev -l (pv) -a pv=yes
Makes a new hdisk a pysical volume.
chpv
chpv
chpv
chpv
Removes a disk from the system.
Adds the removed disk back into the system.
Changes pv allocatable state to YES
Changes pv allocatable state to NO
-v
-v
-a
-a
r
a
y
n
(pv)
(pv)
(pv)
(pv)
migratepv (old pv) (new pv)
PV, both
Moves all LV's from one PV to another
PV's must be in the same volume group.
Migratepv cannot migrate striped logical volumes, use cplv and rmlv.
replacepv (old pv) (new pv)
(4.3.3 onwards)
/usr/lpp/diagnostics/bin/uformat -d (pv) -o certify
Will cerify ( read all on disk media ) scsi disks only.
Volume Groups (VG's)
-------------------lsvg
lsvg
lsvg
lsvg
lsvg
(vg)
-l (vg)
-p (vg)
-o
Lists
Lists
Lists
Lists
Lists
varyonvg (vg)
varyonvg -f (vg)
varyonvg -s (vg)
can be
varyoffvg (vg)
all
the
all
all
all
volume groups
volume group details
logical volumes in the volume group
physical volumes in the volume group
varied on volume groups
Vary On a volume group
Forces the varyon process
Vary on a VG in maintenance mode. LV commands
used on VG, but LV,s cannot be opened for I/O.
Vary Off a volume group
synclvodm (vg)
Tries to resync VGDA, LV control blocks and ODM.
synclvodm -v (vg)
Rebuilds the LVCB.
(the vg needs to be varied on before running synclvodm)
mkvg -y(vg) -s(PP size) (pv)
mkvg -y datavg -s 4 hdisk1
reducevg (vg) (pv)
reducevg -d (vg) (pv)
the PV
reducevg (vg) (PVID)
when a
(pv)
reducevg -df (vg) (pv)
Create a volume group
Removes a volume group
Removes a volume group and delete all LV's on
Removes the PVID disk reference from the VGDA
disk has vanished without the reducevg (vg)
command being run first.
Deletes all LV's from the VG and removes the VG
from the disk. If the last disk in the VG then
the VG is deleted.
extendvg (vg) (new pv)
Adds another PV into a VG.
exportvg (vg)
entries and
Exports the volume group, removes the VG
removes all FS entries from /etc/filesystems
but
leaves the mount points.
Note : Cannot export a VG if it has active paging space, turn off
paging,
reboot before exporting VG. Exporting removes entries from
filesystems
file but does not remove the mount points.
chvg -a y (vg)
start.
chvg -u (vg)
Auto Vary On a volume group at system
lqueryvg -Atp (pv)
disk.
Details volume group info for the hard
importvg -y (vg name) (pv)
importvg (pv)
etc.
Import a volume group from a disk.
Same as above but VG will be called vg00
Unlocks a locked volume group.
4.3 onwards, importvg will automatically varyon the VG.
chvg -Q (y/n) (vg name)
reorgvg (vg) (lv)
at the
Turns on/off Quorum checking on a VG.
Reorganised a fragmented LV, must state an LV
command line else the first LV in the VG is
picked.
Does not reorg the PP's of striped LV's.
Logical Volumes (LV's)
---------------------lslv (lv)
lslv -l (lv)
lsattr -EHl (lv)
Lists the logical volume details
Lists the physical volume which the LV is on
Displays more logical volume details
device.
sysdumpdev -l
sysdumpdev -e
sysdumpdev -L
Lists current dump destination.
Estimates dumpsize of the current system in bytes.
Displays information about the previous dump.
sysdumpstart -p
device.
sysdumpstart -s
device.
Starts a dump and writes to the primary dump
Starts a dump and writes to the secondary dump
(MCA machine can also dump if key is in service position and the reset
button is pressed)
sysdumpdev -p (dump device) -P
permanently
Sets the default dump device,
Analyse dump file :echo "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0
snap -gfkD -o /dev/rmt0
uses tar.
Copy dump to tape to send to IBM support,
------------------------------------------------------------------------------PA
GING SPACE (PS's)
------------------------------------------------------------------------------ls
ps -a
lsps -s
lsps (ps)
Lists out all paging space
Displays total paging and total useage
swappon /dev/ps
/dev/paging00
swappoff /dev/ps
only )
Activates a paging device eg
Deactivates a paging device ( AIX 5.x
mkps -s(No of PP's) -n -a (vg)
mkps -s(No of PP's) -n -a (vg) (pv)
-n = don't activate/swapon now
reboot
-a = activate/swapon at
mklv -b n -t paging -y hd6 (vg) (No of PP's) (pv)
Creates paging space using the mklv command.
chps -a n (ps)
chps -s(No of PP's) (ps)
chps -d(No of PP's) (ps)
Turns off paging space.
Increases paging space.
Decreases paging space ( AIX 5.x only )
chlv -n (new name) (old name)
rmps (ps)
off
removed.
Change paging space name
Remove paging space. PS must have been turned
and then the system rebooted before it can be
Note : Need to change the swapon entry in /sbin/rc.boot script if you
are
changing the default paging space from /dev/hd6. You also need to
------------------------------------------------------------------------------cr
ontab
crontab
crontab
crontab
crontab
crontab
-l
-e
-l > (filename)
(filename)
-r
-v
List out crontab entrys
Edit crontab entrys
Output crontab entrys to a file
Enter a crontab from a file
Removes all crontab entrys
Displays crontab submission time.
/var/adm/cron/cron.allow
use.
/var/adm/cron/cron.deny
use.
/var/adm/cron/crontab
entries.
/var/adm/cron/log
File containing users allowed crontab
File containing users denied crontab
Directory containing users crontab
Cron log file.
at (now + 2 minutes, 13:05, etc) {return}
Command or schell script {return}
{CTRL D}
Schedule a job using at
echo "shutdown -Fr" | at now + 1 minute
at -l
atq
Lists out jobs scheduled to run via at command
at -r (at job No)
atrm (at job No)
Removes an at job scheduled to run.
/var/adm/cron/at.allow
/var/adm/cron/at.deny
/var/adm/cron/atjobs
/tmp/crout(pid)
File containing users allowed at use.
File containing users denied at use.
Directory containing users at entries.
+
+
+
(1
(1
(1
(1
-rwxrwxrwx
|||
SVTX)
execute)
execute)
execute)
permissions for owner
permissions for group
permissions for others
|
Owner
|
Group
-rwSrwxrwx = SUID
|
Others
-rwxrwSrwx = SGID
chown (new owner) (filename)
chgrp (new group) (filename)
drwxrwxrwt = SVTX
Changes file/directory owners
Changes file/directory groups
chown (new owner).(new group) (filename)
umask
umask abc
Do both !!!
Displays umask settings
Changes users umask settings
where ( 7 - a = new file read permissions)
( 7 - b = new file write permissions)
( 7 - c = new file execute permissions)
eg umask 022 = new file permissions of 755 = read write and execute for
owner
read ----- and execute for
group
read ----- and execute for
other
mrgpwd > file.txt
Creates a standard password file in file.txt
passwd
Change current user password
pwdadm (username)
Change a users password
pwdck -t ALL
Verifies the correctness of local authentication
lsgroup
mkgroup
chgroup
rmgroup
ALL
(new group)
(attribute) (group)
(group)
Lists all groups on the system
Creates a group
Change a group attribute
Removes a group
------------------------------------------------------------------------------US
ERS / ENVIRONMENT
------------------------------------------------------------------------------pa
sswd -f
description)
passwd -s
Change current users gecos (user
chfn (username)
chsh (username) (shell)
Changes users gecos
Changes users shell
Change current users shell
env
printenv
Displays values of environment variables
id
id (user)
Displays current user's uid and gid details
Displays user uid and gid details
whoami
who am i
Displays current user details
(or who -m)
who
w
who -b
Displays details of all users currently logged in.
uptime
Displays number of users logged in, time since last
reboot, and the machine load averages.
lsuser
lsuser
lsuser
lsuser
Displays system reboot time
ALL
(username)
-a(attribute) (username or ALL)
-a home ALL
Lists all users details
Lists details for user
Lists user attributes
mkuser -a(attributes) (newuser)
Add a new user
chuser (attributes) (user)
chuser login=false (user)
Change a user
Lock a user account
rmuser -p (user)
files
Removes a user and all entries in security
usrck -t ALL
Checks all the user entires are okay.
fuser -u (logical volume)
LV
fuser -k /dev/lv02
using
Displays processes using the files in that
Will send a kill signal to all processes
/dev/lv02
ruser -d -f (user)
ruser -d -p (host)
ruser -d -r (host)
Deletes entry in /etc/ftpusers file
Deletes entry in /etc/host.lpd file
Deletes entry in /etc/hosts.equiv file
ruser -s -F
ruser -s -P
ruser -s -R
Shows all entries in /etc/ftpusers file
Shows all entries in /etc/host.lpd file
Shows all entries in /etc/hosts.equiv file
ruser -X -F
ruser -X -P
ruser -X -R
Deletes all entries in /etc/ftpusers file
Deletes all entries in /etc/host.lpd file
Deletes all entries in /etc/hosts.equiv file
------------------------------------------------------------------------------IN
ITTAB
------------------------------------------------------------------------------te
linit S
telinit 2
telinit q
Switches to single user mode.
Switches to multi user mode.
Re-examines /etc/inittab
lsitab -a
lsitab (ident eg tty1)
Lists all entries in inittab
Lists the tty1 entry in inittab
mkitab ("details")
chitab ("details")
Creates a new inittab entry
Ammends an existing inittab entry
rmitab (ident eg tty1)
Removes an inittab entry.
chitab "tty1:2:respawn:/usr/bin/getty /dev/tty1"
------------------------------------------------------------------------------OD
M
------------------------------------------------------------------------------od
mget -q "name=lp1" CuDv |more
database.
Gets lp1 info from pre-defined
-s
Diplays number of paging events since system
-f
-i
start.
Diplays number of forks since system start.
Diplays number of interupts by device since
iostat (drive) (interval) (count)
statistics.
iostat hdisk0 5 20
Reports i/o and cpu
iostat -d (drive) (interval) (count)
statistics.
Limits report to drive