Professional Documents
Culture Documents
ar -v -t (archive file)
ar -v -x (archive file)
ar -v -t /usr/lib/libC-r.a
-c
-o
-l
-s
Displays
Displays
Displays
Displays
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
snap -gc
info)
snap -r
oslevel
whence (program)
whereis (program)
what (program)
executable
lslpp
lslpp
lslpp
lslpp
lslpp
-L all
-L (program set name)
-f
-ha
-w /usr/bin/swapon
lppchk -c
lppchk -l
/usr/sbin/install_assist
/usr/sys/inst.images/sys.bundles
alt_disk_install -c hdisk1
alt_disk_install -w
alt_disk_install -s
alt_disk_install -x
Preview install
Remove fileset
List all software on device
------------------------------------------------------------------------------TERMINALS / DISPLAYS
------------------------------------------------------------------------------/usr/share/lib/terminfo
files.
tty
termdef
lscons
device
chcons -a login=enable (device eg /dev/tty1)
device
lsdisp
chdisp
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
------------------------------------------------------------------------------NETWORK
------------------------------------------------------------------------------host (ip or hostname)
hostname
hostname (hostname)
Displays hostname
Sets the hostname until next reboot
lsdev -Cc if
interfaces
(device
(device
(device
(device
(device
name)
name)
name)
name)
name)
Changes hostname
(destination)
( gateway )
Adds route and adds entry into ODM, route survives a reboot,
route -rn
odmget -q "attribute=route" CuAt
lsattr -EHl inet0
hostname
netstat -i
entstat -d (ethernet adapter eg en0)
arp -a
no -a
or
stopsrc -g tcpip
/etc/tcp.clean
all
/etc/rc.tcpip
destination supplied.
start all
exportfs -a
exportfs -u (filesystem)
Un-exports a filesystem
mknfs
rmnfs
mknfsexp -d /directory
mknfsmnt
nfso -a
nfso -o option=value
nfso -o nfs_use_reserved_port=1
------------------------------------------------------------------------------BACKUPS
------------------------------------------------------------------------------MKSYSB (Uses AIX backup command)
-----mkszfile -f
mkszfile -X
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)
from /
mkvgdata (vg)
Lists archive
AIX ARCHIVE
----------find (filesystem) -print | backup -iqvf (filename or device)
Backup by filename.
eg find /usr/ -print | backup -iqvf /dev/rmt0
backup -(backup level 0 to 9) -f (filename or device) ("filesystem")
Backup by inode.
eg backup -0 -f /dev/rmt0 "/usr"
file
AIX RESTORE
----------restore -qTvf (filename or device)
Lists archive
or flcopy
COPYING TAPES
------------dd if=/dev/rmt0 of=(filename)
dd if=(filename) of=/dev/rmt0
or tcopy
------------------------------------------------------------------------------VI Commands
------------------------------------------------------------------------------:g/xxx/s//yyy/
bootinfo -b
from
bootinfo -k
bootinfo -r
bootinfo -s (disk device)
bootinfo -T
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
rmdev -l (device)
defined
rmdev -l (device) -d
rmdev -l (device) -SR
lsresource -l (device)
cfgmgr
cfgmgr -i /dev/cd0
/dev/cd0
Configures devices
Configure devices and install drivers from
cfgmgr -S
disks
cfgmgr -l scsi0
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
drslot
drslot -i -c pci -s U0.1-P1-I3
next to
identified.
rmdev -l pmc0
mkdev -l pmc0
------------------------------------------------------------------------------TAPE DRIVES
------------------------------------------------------------------------------rmt0.x where x = A + B + C
A = density
B = retension
C = rewind *
tctl
tctl
tctl
tctl
tctl
-f
-f
-f
-f
-f
(tape
(tape
(tape
(tape
(tape
0 = high
0 = no
0 = yes
device)
device)
device)
device)
device)
fsf (No)
bsf (No)
rewind
offline
status
4 = low
2 = yes
1 = no ( * rewind on finish )
Skips forward (No) tape markers
Skips back (No) tape markers
Rewind the tape
Eject the tape
Show status of tape drive
changes block size to 512 bytes
(4mm = 1024, 8mm = variable but
1024 recommended)
< /dev/rmt0
export $LPDEST="pqname"
session
lsvirprt
attributes.
lsallq
qchk -A
lpstat
lpstat -p(queue)
lpstat -w
names)
enq -U -P(queue)
enable (queue)
Enable a queue
enq -D -P(queue)
disable (queue)
Disable a queue
startsrc -s qdaemon
lssrc -s qdaemon
stop -s qdaemon
enscript
enscript
queue
enscript
queue
enscript
8
(filename)
-d(queue) (filename)
-r (filename)
------------------------------------------------------------------------------FILE SYSTEMS
------------------------------------------------------------------------------Physical Volumes (PV's)
----------------------lspv
lspv (pv)
lspv -l (pv)
volume
lspv -p (pv)
PV
lspv -M (pv)
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
chpv
chpv
chpv
chpv
-v
-v
-a
-a
r
a
y
n
(pv)
(pv)
(pv)
(pv)
Migratepv cannot migrate striped logical volumes, use cplv and rmlv.
replacepv (old pv) (new pv)
(4.3.3 onwards)
(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
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)
the VG is deleted.
extendvg (vg) (new pv)
exportvg (vg)
entries and
but
picked.
Copy an LV to a new LV
rmfs (fs)
defrag -q (fs)
defragfs -r (fs)
defragfs (fs)
fsck (fs)
Verify a file system, the file system must be
unmounted!
fsck (-y or -n) (fs) Pre-answer questions either yes or no !
fsck -p (fs)
Will restore primary superblock from backup copy if
the
superblock is corrupt.
( or dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00
of=/dev/lv00 )
Mirroring
--------mklv -y (lv) -c(copies 2 or 3) (vg) (No of PP's) (PV Name optional)
Creates a mirrored named logical volume.
mklvcopy -s n (lv) (copies 2 or 3) (pv)
Creates a copy of a logical volume onto another physical volume. The
physical
volume MUST be in the same volume group as the orginal logical volume !
rmlvcopy (lv) (copies 1 or 2)
rmlvcopy (lv) (copies 1 or 2) (pv)
syncvg -p (pv)
copies
syncvg -l (lv)
syncvg -v (vg)
displays
change bootlist
bootinfo -b
bootinfo -t
bosboot -a -d (/dev/pv)
volume.
mkboot -c -d (/dev/pv)
volume.
savebase -d (/dev/pv)
device.
lslv -m hd5
bootinfo -y
bit
genkex
------------------------------------------------------------------------------SYSTEM DUMP
------------------------------------------------------------------------------1, AIX 4.2.1 and greater supports system dump to paging space.
2, AIX 4.3.3 and greater supports system dump to mirrored paging space.
3, Primary dump device must be in the rootvg
4, Secondary dump device can be outside rootvg unless it is a paging
device.
sysdumpdev -l
sysdumpdev -e
sysdumpdev -L
sysdumpstart -p
device.
sysdumpstart -s
device.
(MCA machine can also dump if key is in service position and the reset
button is pressed)
sysdumpdev -p (dump device) -P
permanently
swappon /dev/ps
/dev/paging00
swappoff /dev/ps
only )
-a = activate/swapon at
------------------------------------------------------------------------------SCHEDULING
------------------------------------------------------------------------------crontab
crontab
crontab
crontab
crontab
crontab
-l
-e
-l > (filename)
(filename)
-r
-v
/var/adm/cron/cron.allow
use.
/var/adm/cron/cron.deny
use.
/var/adm/cron/crontab
entries.
/var/adm/cron/log
/var/adm/cron/at.allow
/var/adm/cron/at.deny
/var/adm/cron/atjobs
/tmp/crout(pid)
------------------------------------------------------------------------------SECURITY
------------------------------------------------------------------------------nulladm /var/adm/wtmp
groups
setgroups
is
is
is
is
-rwxrwxrwx
|||
-
(4
(4
(4
(4
SUID)
read)
read)
read)
(2
(2
(2
(2
-rwxrwxrwx
|||
-
SGID)
write)
write)
write)
+
+
+
+
(1
(1
(1
(1
-rwxrwxrwx
|||
-
SVTX)
execute)
execute)
execute)
|
Owner
|
Group
-rwSrwxrwx = SUID
|
Others
-rwxrwSrwx = SGID
drwxrwxrwt = SVTX
Do both !!!
passwd
pwdadm (username)
pwdck -t ALL
lsgroup
mkgroup
chgroup
rmgroup
ALL
(new group)
(attribute) (group)
(group)
------------------------------------------------------------------------------USERS / ENVIRONMENT
------------------------------------------------------------------------------passwd -f
description)
passwd -s
chfn (username)
chsh (username) (shell)
env
printenv
id
id (user)
whoami
who am i
who
w
who -b
uptime
lsuser
lsuser
lsuser
lsuser
ALL
(username)
-a(attribute) (username or ALL)
-a home ALL
Change a user
Lock a user account
rmuser -p (user)
files
usrck -t ALL
chlang (language)
Changes the language settings for system
or user.
En_GB
= PC850 code pages
en_GB
= ISO8859 code pages (Great Britain)
C
= posix
su - (user)
environment.
su (user)
the
------------------------------------------------------------------------------REMOTE USERS
------------------------------------------------------------------------------ruser -a -f (user)
ruser -a -p (host)
ruser -a -r (host)
ruser -d -f (user)
ruser -d -p (host)
ruser -d -r (host)
ruser -s -F
ruser -s -P
ruser -s -R
ruser -X -F
ruser -X -P
ruser -X -R
------------------------------------------------------------------------------INITTAB
------------------------------------------------------------------------------telinit S
telinit 2
telinit q
lsitab -a
lsitab (ident eg tty1)
mkitab ("details")
chitab ("details")
odmchange
odmdrop
-------------------------------------------------------------------------------
errpt
errpt -a
errpt -j (identifier)
Note : The errclear command will delete all entries older than the
numbers of
days specified in the days paramenter. To delete ALL entries used
0.
errlogger "message up to 230 chrs"
Enters an operator notifaction message into the errorlog.
alog -L
alog -o -t (type)
alog -o -t boot
-s
-f
-i
start.
sar -u -P ALL 10 10
processors
/usr/samples/kernel/vmtune
------------------------------------------------------------------------------DOS DISKETTES
------------------------------------------------------------------------------dosdir
dosdir (directory)
Writes a file to
dosdel (dosfile)
diskette
dosformat
------------------------------------------------------------------------------SENDMAIL
------------------------------------------------------------------------------sendmail -bi
newaliases
sendmail -bp
mailq
sendmail -q
stopsrc -s sendmail
startsrc -s sendmail "-bd -q30"