Common Unix / AIX / PSSP / DB2 Commands
By Junshan Li 2002

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X Y Z
 

A

aixterm -bg purple &    ## Creates an aix terminal window with purple background
aixterm -ls -rightscroll -fn rom8 -display @D -T `uname -n` & &    ## Exceed command string
aixterm -bg blue -fg yellow -cr red &    ## -cr: red cursor color
alias                              ## Defines or displays aliases.
alias tools="cd /tpc/tpcd/tpcd/tools"
alias cust="cd /tpc/tpcd/tpcd/custom"
apropos                        ## Locates commands by keyword lookup.
apropos compiler         ## compiler is the keyword to locate different compilers on the system
ar -t -X 32_64 libdb2osse.a   ## list the content of the archive file
arp -a                          ## Address Resolution Protocol, translate ip addr to mac address
awk                             ## a good language for text processing on unix systems

B

banner                        ## Writes ASCII character strings in large letters to standard output.
banner <string>
basename                   ## Returns the base file name of a string parameter.
basename /u/junshan/bin/1cfg.ksh      ## returns "1cfg.ksh"
bc                              ## Very useful unix calculator, similar to "dc"
bg                              ## Runs jobs in the background.
bindprocessor            ## Binds or unbinds the kernel threads of a process to a processor.
        bindprocessor -q
bootinfo -y   ## to find out if the kernel is 32-bit or 64-bit
bosboot -aD -k /usr/lib/boot/unix_mp_kdb   ## set up env. for kdb kernel.
bsh                            ## invokes the Bourne shell.
 

C

cal [ [ Month ] Year ]  ## Displays a calendar.
cat [ -q ] [ -r ] [ -s ] [ -S ] [ -u ] [ -n [ -b ] ] [ -v [ -e ] [ -t ] ] [ - | File ... ]   ## Concatenates or displays files.
        cat /usr/lpp/bos/aix_release.level  ## Check AIX release level
        cat /usr/lpp/ssp/opt*    ## get PSSP installed level
        cat /etc/resolv.conf     ## information about the domain name server
cd                               ## Changes the current directory.
cd ..
cd -
cfgmgr                         ## Configures devices
        cfgmgr -v
chdev                          ## Changes the characteristics of a device.
        chdev -l hdisk103 -a pv=yes
        chdev -l ent1 -l jumbo_frames=yes
chfs                             ## Changes attributes of a file system.
chfs -a size=+10240 /tmp
chmod                         ## Changes file modes (file permissions).
        chmod a+x *sh
        chmod 777 log spool execute
        chmod +ug <file name>  ## Turn on sticky bit

chown                         ## Changes the owner or group associated with a file.
        chown -R junshan.usr /llperf
        chown tpcd.dbadm /dev/rdata*  /dev/ridx*  /dev/rtm*

chps                            ## Changes attributes of a paging space.
chps -s224 hd6           ## add 224 logical partitions to paging space device hd6
clear                            ## Clears the terminal screen.
cmp [ -l | -s ] File1 File2  ## Compares two files.
compress                     ## Compresses data and produces a .Z file
cp                                ## copies files or directories (with -R option)
crfs                              ## creates a file system
crfs -v jfs -d ll_lv -m /llperf -A yes
crontab                        ## Submits, edits, lists, or removes cron jobs
crontab -l
csh                              ## Invokes the C shell.
cshutdown -r -N 37-39  ##  shutdown and recover nodes
ctrace sum /unix             ## A trace tool for AIX performance evaluation
        installp -acFd /u/bksmith/tools/pmtoolkit/pmtoolkit.433.122 all
        installp -aFd /u/bksmith/tools/ctrace/43/ctrace.43.build729.pmtoolkit all
        installp -aFd /u/bksmith/tools/mtrpost/mtrpost.build98 all
        ctrace -I ls
        pmloadsvcs
        ctrloadsvcs
        ctrace ls
        mtrpost
        mtrpost -d run.list
        mtrpost -p all -f routine -f instruction
        ctrace -I loop
        mtrpost -I loop -p all -f routine -f instruction
        eploadsvcs
        tprof -J 238 -ske -x sleep 10
        pstat -S
        pm_start -F 1
        pm_start -F 0.5
        pm_start -F 0.01
        pm_stop
        pm_start -help
cu                                ## Connects directly or indirectly to another system.
cu -ml /dev/tty0
cut                               ## Writes out selected bytes, characters, or fields from each line of a file.
        cut -f 1,5 -d : /etc/passwd
        cut -f2 -d":" ora_errors|sort -u
llq |grep junshan|cut -c10-13
 

D

## Work with defects                         ## A utility to open, view, modify defects
        Defect -view 89250 -long|more
        Verify -accept -defect 89160
        Defect -modify 70682  -originator lij -remarks - < /tmp/lij
        Track -view -defect 72177 -release ssp_rmo2 -long|more
        User -modify <your_cmvc_id> -family <admin/aix> -area AUS/<dept>   ## update the CMVC area information
        Defect -cancel 54233 -remarks "Belong to other"     ## cancel a defect.
        Report -view DefectView -where "originLogin in ('lij')" |sort +1
        Defect -note 89160 -remarks "This is a remark."
        Feature -note 12345 -remarks "remarks"
        Report -view FeatureView -where "originLogin in ('junshan')"
        Feature -design 46805 -remarks "Moving to design stage"
        Feature -modify 46960 -target "2003/08/31"
        Feature -design 45376 -remarks "Moving to design stage"
        Feature -size 45376 -remarks "Moving to size stage"
        Feature -review 45376 -remarks "Moving to review stage"
        Feature -accept 45376 -remarks "Moving to working stage"

date                             ## Displays or sets the date or time.
        cp lij lij.`date +"%d%h%y"`
        dsh -av date
        poe date

## DB2 Commands:
db2icrt -u qual -p 10010 -s eee qual
db2 connect to tpcd
db2 "create NODEGROUP ng_all on node (1)"
db2 "create NODEGROUP ng_all on node (0)"
db2 "create NODEGROUP ng_node1 on node (0)"
db2 "drop nodegroup ng_all"
db2untag /dev/rqldp1
db2 create database TPCDQUAL on /db collate using identity with \"TPCDQUAL 1GB\"
db2 drop db qual  ## for recovery
db2 connect to tpcdqual
cd $HOME/tpcd/custom
db2 -tvf create_nodegroups.ddl
db2 -tvf create_bpools.ddl              ## Create buffer pools
db2 -tvf tempg.ddl                          ## Create temp tablespace
db2 -tvf create_tbspaces.ddl           ## Create tablespaces
db2 DROP TABLESPACE TEMPSPACEX
db2 -tvf create_temp8K.ddl
db2 -tvf create_tables.ddl                ## Create tables
db2 -tvf createUfTables.ddl
db2 drop table qual.region
db2 grant connect on database to public
time db2 -tvf dbmcfg_loadQUAL
time db2 -tvf dbcfg_loadQUAL   ## on both
db2stop
db2start
db2 -tvf load_partsupp.ddl
db2 -tvf load_part.ddl
time db2 -tvf load_customer.ddl
time db2 -tvf load_supplier.ddl
time db2 -tvf load_orders.ddl
time db2 -tvf load_lineitem.ddl
db2 "load from /sortdata/links/region.tbl of del modified by coldel| fastparse noheader messages /tmp/qual/region.msg replace into TPCD.REGION nonrecoverable"
db2 "load from /sortdata/links/nation.tbl of del modified by coldel| fastparse noheader messages /tmp/qual/nation.msg replace into TPCD.NATION nonrecoverable"
time db2 -tvf create_indexes.ddl    ## create indexes:
time db2 -tvf runstats.ddl               ##  runstats
## editted tpcd.setup under custom
/home2/db2inst1/tpcd/tools/setupDir
buildtpcdbatch QUAL                  ##  run buildtpcdbatch QUAL
$HOME/tpcd/tools/setupRun       ## # 11) setup run
echo "1" > /home2/db2inst1/tpcd/QUAL.db2inst1.update.pair.num   ## Set up at necessary file
runqual                                         ## run qualification database (query 1 to 22).
/usr/opt/db2_08_01/instance/db2iupdt -w 64 db2inst1  ## update db2 instance as root
db2_kill
db2 connect reset
db2 get dbm cfg|grep DIAG
db2batch -d tpcd -f tpcd/auditruns/run75/querytext/qtext10.sql -r tmp.out
db2 force application all
db2 "select tbspace, overhead, transferrate from syscat.tablespaces"
db2 -svtf update.tbs
db2 set current explain mode explain
db2 set current explain mode no
db2 list applications
db2 commit
db2 update db cfg for tpcd using num_iocleaners 4

dbx                             ## debugger, must compile c/c++ program with -g option
dbx core
dc                               ## desk calculator, similar to "bc"
dd                               ## Converts and copies a file.
        ssaraid -Il ssa11 -n hdisk17
        dd if=/dev/rhdisk17 of=/dev/null bs=64k
        dd if=/dev/rhdisk17 of=/dev/null bs=32k
        dd if=/dev/rhdisk17 of=/dev/null bs=96k
        dd if=/dev/rhdisk17 of=/dev/null bs=128k
        dd if=/dev/rhdisk17 of=/dev/null bs=512k
        dd if=/dev/zero of=/dev/rhdisk17 bs=512k
        dd if=/dev/zero of=/dev/rhdisk17 bs=128k
        dd if=/dev/zero of=/dev/rhdisk17 bs=96k
        dd if=/dev/zero of=/dev/rhdisk17 bs=64k
        dd if=/dev/zero of=/dev/rhdisk17 bs=32k
        ssaraid -D -l ssa11 -nhdisk16 -u
        ssaraid -D -l ssa11 -nhdisk17 -u
        time dd if=/dev/rhdisk32 of=/dev/null bs=128k count=10000   ## good to test hdisk speed together with iostat
df -k                           ## Reports information about space on file systems in kilobytes.
diag                            ## Performs hardware problem determination.
        diag -d ssa0
        diag -c -d css0  // for hardware
        diag -A -d css0
diff                             ## Compares text files.
dirname                      ## Writes to standard output all but the last part of a specified path.
dirname /afs/aix/u/lij    ## returns "/afs/aix/u"
dosdir                        ## Lists the directory for DOS files.
dsh                            ## Distributed shell
        dsh -q               ## display if working collective is setup.
        dsh -av sysctl whoami | dshbak -c | more
        dsh -av 'lsattr -El sys0 | grep fullcore '
        dsh -av slibclean
        dsh -av 'lsattr -El css0 | grep win_pool'
        dsh -vN f123 'prtconf|egrep -i "Memory Size"'|dshbak -c|more
        time dsh -N llperf "mkvg -f -y llvg -s '32' hdisk1"
        time dsh -N llperf "mklv -y ll_lv -t jfs -a 'c' llvg 240 hdisk1"
        time dsh -N llperf "crfs -v jfs -d ll_lv -m /llperf -A yes"
        time dsh -N llperf "mount /llperf"
        dsh -av slibclean; slibclean
        dsh -av sum /usr/lib/libpthreads.a
        dsh -av sum /unix
        dsh -G -av /var/sysman/supper update user.admin
        dsh -av /usr/lpp/ssp/css/read_regs -l css0 -X | grep Segment
        dsh -av 'lscfg -vp|grep -p ROM' |dshbak -c  ## To find out firmware
        dsh "/usr/sbin/sar -P ALL -u'' 1 1"|grep -      ## check cpu and memory usage
        dsh -av lslpp -l mmfs* |dshbak -c|more        ##  view dsh comments collectively

du                              ## Summarizes disk usage.
        du -sk /var/*
        du -k . | sort -n
dump                         ## Dumps selected parts of an object file.
        dump -H libdb2.a
        dump -H xhpc
        bootinfo -y   ## to find out if the kernel is 32-bit or 64-bit
        dump -ov /unix  ## to find out if the kernel is 32-bit or 64-bit
        dump -ovX64 /unix  ## to find out if the kernel is 64-bit
 

E

Efence                     ## Make switch unavailable
Eunfence 14            ## unfence node 14
Eunfence -p0 225 177 145 81 49 33
Eprimary                 ## Check swith primary nodes on its topology
Estart -p 0               ## start switch on planar 0
Estart -p 1               ## start switch on planar 1

echo                          ## Writes character strings to standard output.
        echo $HOME
egrep                        ## Similar to grep, but more powerful.  Searches a file for a pattern.
entstat ent0               ## get the ethernet status data
env                           ## Displays the current environment or sets the environment for the execution of a command.
eploadsvcs               ##  Load performance kernel extensions
        pm_start
        tprof -J 238 -ske -x sum /unix
        pm_stop
errclear  <days>       ## Deletes entries from the error log.
        errclear 0
errpt                         ##  Generates a report of logged errors.
        errpt -a | more
        errpt -aj 45000
        errpt -j 4007FD6A
        dsh -av errpt -j 4007FD6A | sort +2 | grep -v TIMESTAMP
        errpt -a -N OPERATOR |pg
exit                           ## exit the login shell
export PATH=/usr/lpp/LoadL/full/bin:$PATH
exportfs                    ## Exports and unexports directories to NFS clients.
exportvg                   ## Exports the definition of a volume group from a set of physical volumes.
        exportvg llvg             ## must "varyoffvg llvg" first
        export WCOLL=/llperf/Junshan/Run/wcoll
extendlv                    ## Increases the size of a logical volume by adding unallocated physical partitions from within the volume group.
extendvg                   ## Adds physical volumes to a volume group.

F

fg                             ## Runs jobs in the foreground.
file                            ## Determines the file type.
        file *
filemon                     ## Monitors the performance of the file system.  Need to "trcstop" after a short period.
fileplace                   ## Displays the placement of file blocks within logical or physical volumes.
find                          ## Finds files with a matching expression.  Very useful.
        find . -name *.pl -print
finger                       ## Shows user information. This command is the same as the f command.
        finger lij
fs lq                          ## Checks quota of a user has
fsck                         ## Checks file system consistency and interactively repairs the file system.
        fsck /dev/dbrawlv8
        time yes| fsck /rawdata00007
ftp                           ## Transfers files between a local and a remote host.
        ftp -n << EOF
            open d02xdg005.maint.southbury.ibm.com
            user rootdb2 $1  # you have to provide a password in order to run this script.
            cd /dataprop
            lcd /tempfs
            get aixCAE61f3.tar
            bye
        EOF
 

G

gprof                     ## Displays call graph profile data.
        a) compile source code using -pg flag: cc -pg test.c -o test1
        b) run test1 to get gmon.out
        c) check code performance using: gprof gmon.out
grep                      ## Searches a file for a pattern.
 
 

H

head                     ## Displays the first few lines or bytes of a file or files.
head -20 <filename>
history                  ## Displays the command history
hmcmds off 2:9     ## Turn off node 9 of frame 2, it's better using normal shutdown procedures, such us "shutdown -Fr"
hmcmds on 2:9
        for node in 1 2 4 5 6; do
               hmcmds off 1:$node
               hmcmds on 1:$node
        done
        hmmon -G -Q 17:2|more
        hmcmds -G -v off 17:2
        hmcmds -G -v on  17:2
host                      ## Resolves a host name into an Internet address or an Internet address into a host name.
        host performance.pok.ibm.com
hostname              ## Sets or displays the name of the current host system.
        hostname c698s.ppd.pok.ibm.com  ## set the hostname of the machine
 

I

id                         ## Displays the system identifications of a specified user.
ifconfig                 ## Configures or displays network interface parameters for a network using TCP/IP.
        ifconfig -au
        tcpdump -i en0
        ipreport /tmp/iptrace.log > /tmp/ipreport.log
        iptrace -i en0 /tmp/iptrace.log
        netstat -s
        entstat ent0
        ifconfig en0 down detach
        chdev -l ent0 -a media_speed=100_Full_Duplex
        ifconfig -d ssa49 up
        ifconfig css0           ## Will provde switch IP address
        ifconfig en0            ## Provide node IP address
importvg              ## Imports a new volume group definition from a set of physical volumes.
        importvg -y llvg hdisk1
installp                 ## Installs available software products in a compatible installation package.
        installp -agpXd . all
        installp -aFd pmtoolkit.433.latest all
instfix -i                ##  Check APAR installations
        instfix -i -k IY18164  ## IY18164 is one of the PTFs.
inutoc [directory] ## Creates a .toc file for directories that have backup format file install images.
inutoc .
iostat                   ## Reports CPU statistics and input/output statistics for tty devices, disks, and CD-ROMS.
        iostat -d -s hdisk313 hdisk316 hdisk321 hdisk314 hdisk311 hdisk310 hdisk312 hdisk315 1
        iostat 1
        iostat -s -t 5        ## show iostat for every 5 seconds
ipcrm                  ## Removes message queue, semaphore set, or shared memory identifiers.
ipcs                    ## Reports interprocess communication facility status.
        ipcs -a | grep qual
        ipclean -a
 

J

jobs                    ## Displays status of jobs in the current session.
 

K

## Kerberos Commands:
        /usr/lpp/ssp/kerberos/bin/ksrvutil list
k4init root.admin

## Work with kdb:
        KDB
        kdb                  ## kernel debugger
        1) sysdumpdev -L
        2) kdb /dev/lv00 /unix  ## /dev/lv00 is the dump device
        3) do dd command recommended on the kdb command
        4) kdb <uncompressed file> /unix
        5) in kdb: 0> stat 0> thread

kill                   ## Sends a signal to running processes.
        kill -9 <pid>
        kill 43184 72506
        kill -9 %1
killall                ## Cancels all processes except the calling process.  Should not be used as "root", otherwise have to reboot.
ksh                  ## Invokes the Korn shell.

L

##  LED codes:
http://force.austin.ibm.com/Info/V4/4LEDs.html

## Linux installation:
           a) Used GNOME installation, text version.
           b) Need to pick the correct display (1024x768x4mgx76Hz)?
           c) Network: hostname: spPerformance.pok.ibm.com
                   IP address: 9.117.7.17
                   DNS: 9.117.5.254, 9.117.253.254
                   Default gateway: 9.117.7.251
                   Net mask: 255.255.255.0
                   Configure Mode: manual
                   Net device: tr0
                   Kernel module: ibmtr
                   I/O port (opt): <null>
                   Irq (opt): <null>

## LoadLeveler commands:
        llctl -v                     ## display ll versions.
        llclass                     ## display ll classes
        llq -l c695sn08.25.0 | more
        llq                          ## Query jobs
        llq -s c695sn08.23.0
        llq -x -l c695sn08.25.0 > q.x
        grep -i drain /tmp/log/StartL*
        grep MAX_START LoadL_config.local.c695
        grep LOADLBATCH *
        grep LOADL_ACTIVE *
        /u/junshan/bin/startll.sh
        llcancel -u junshan   ## junshan is the user name, cancel all ll jobs
        llcancel 218
        for i in 107 115 116 117 106 108 148 149; do
            llcancel c695sn08.$i.0
        done
        llctl resume
        llctl -h c695sn03 reconfig
        llctl -g reconfig
        /usr/lpp/LoadL/full/bin/llctl stop
        llstatus | more
        llstatus c695sn02
        llstatus -l | grep lass
        llsubmit measure.cmd
        ## Restart a poe check pointed job:
        poerestart poe.ckpt.20700.0                                                                 ## poe.ckpt.20700.0 is the checkpoint file.
        time llckpt -k 7.0                                                                                  ## start to do a checkpoint.  7.0 is the ll job step number
        CHECKPOINT=yes poe /u/richc/llckpt/cpuhog -procs 2 -resd yes      ## make a poe job checkpointable
        cp /usr/lpp/LoadL/full/samples/llckpt/llrestart .                                       ## Copy the restart checkpointed script over
        llrestart job1.cmd                                                                                 ## Restart a checkpointed job command file

ln [ -f ] [ -s ] SourceFile [ TargetFile ]  ## Links files.
ln -s /rawdata00001/rawdata00000 /rawdata/rawdata00000
ln -sf /rawdata00001/rawdata00000 /rawdata/rawdata00000
ls                     ## Displays the contents of a directory.
        ls -a
        ls -l /unix
        ls -ltr
        ls -ld .
        ls /afs/aix/project/sprellyn/build/rlyns07a/src/ll/lib/api
lsattr                ## Displays attribute characteristics and possible values of attributes for devices in the system.
lsattr -El sys0 -a realmem
lsattr -El ssa0
lsattr -El pdisk1
lsattr -El css0 | grep win_pool
lsattr -El sys0 | grep fullcore
lsattr -El hdisk127
lsattr  -El en0
lsattr -El inet0
lscfg                ## Displays configuration, diagnostic, and vital product data (VPD) information about the system.
        lscfg -vp
        lscfg -vl ssa0
        lscfg -vl pdisk30
        lscfg -vl ssa*|grep ROS  ## determine microcode level.
        lscfg -vp > lscfg-vp.out
        grep DIMM lscfg-vp.out | wc -l
        grep 'Size........................256' lscfg-vp.out | wc -l
lsauthent         ## Lists the authentication methods currently configured on the system.
lsdev              ## Displays devices in the system and their characteristics.
        lsdev -Cc memory
        lsattr -El mem0
        lsdev -Cc processor
        lsdev -Ccadapter
        lsdev -Ccadapter -tssa -Fname
        lsdev -Cc disk -s scsi
        lsdev -C -t hdisk -c disk -s ssar -H
        lsdev -C -c pdisk -s ssar -H | grep Defined
        lsdev -C -c pdisk -s ssar -H
        lsdev -Cc adapter|grep ent
        dsh -G -av 'lsdev -C|grep pdisk'|more
        dsh -G -av 'lsdev -C|grep pdisk|wc'
        dsh -G -av 'lsdev -C|grep hdisk|wc'
        lsdev -C | grep ent0
        rmdev -l en0
        mkdev -l en0
lsfs                 ## Displays the characteristics of file systems.
lsfs /installn5
lsgroup           ## Displays group attributes.
lsgroup ALL
lsitab               ## Lists records in the /etc/inittab file.
lslicense          ## Displays the number of fixed licenses and the status of the floating licensing.
        chlicense -u 125
lslpp               ## Lists software products.
        lslpp -al |grep -i xlc
        lslpp -h "db2*"
        lslpp -al "LoadL*"
        lslpp -h |grep APPLY
        lslpp -hc|grep "08/27"|tr ':' ' '|awk '{ print $2 }'|sort|uniq
lslv                 ## Displays information about a logical volume.
lslv -m dbrawlv8
lslv hd4
lsnamsv -C    ## Shows name service information stored in the database.
lsnfsexp         ## Displays the characteristics of directories that are exported with the Network File System (NFS).
lsps               ## Displays the characteristics of paging spaces.
lsps -a
lspv               ## Displays information about a physical volume within a volume group.
lspv hdisk1
lspv -M hdisk1
lsslot -c pci |grep ssa |pg    ## query for pci slots info
lssrc              ## Gets the status of a subsystem, a group of subsystems, or a subserver.
        lssrc -g nfs
        lssrc -ls hags       ## check the status of group services
        hagsns -s hags
        hagsvote -s hags| more
        hagsmg -s hags| more
        hagspbs -s hags| more
        lssrc -ls hats        ## check the status of topology services
        lssrc -s mmfs
        lssrc -a|grep xntpd   ## clock sync daemon
        hagsctrl -k hags       ## kill (stop) hags group services
        hagsctrl -s hags       ## start hags group services
        stopsrc -c -s sysctld   ## stop sysctl daemon
        startsrc -s sysctld    ## start sysctl daemon
lsuser           ## Displays user account attributes.
lsuser db2inst1
lsuser lij
lsvg             ## Displays information about volume groups.
lsvg rootvg
lsvg -p rootvgt
lsvg -l rootvg
lsvsd -l|grep ACT
 

M

mail             ## Sends and receives mail.
        mail -s "Test Mail" lij@us.ibm.com < lij
        mail -s "SSA disks re-configuration" dluby@us.ibm.com,wombat2@us.ibm.com,lij@us.ibm.com < lijRemarks
make          ## Maintains, updates, and regenerates groups of programs. Execute makefile
man            ## Displays manual entries online.
        man read
maymap      ## A utility to display the ssa disk mapping
        /u/uno/maymap/maymap -h -d ssa1 | more
        maymap -dssa0 -ltph
mkdir <dir>        ## Creates one or more new directories.
        mkdir C_prog
        mkdir -p /tmp/log
mklv          ## Creates a logical volume.
        mklv -y ll_lv -t jfs -a 'c' llvg 240 hdisk1
mklvcopy    ## Provides copies of data within the logical volume.
        mklvcopy  -a c -e x -k -s y  tpcdlv1n2 2 "hdisk1 hdisk2"
mknfsexp    ## Exports a directory to NFS clients.
        mknfsexp -d /nfsperf -t rw -c `cat clients` -r `cat clients` -B
mknfsmnt   ## Mounts a directory from an NFS server.
        /usr/etc/mknfsmnt -f /nfsperf -d /nfsperf -h c694n01 -n -B -A -t rw -w bg -Y -Z -X
mkps          ## Adds an additional paging space to the system.
        mkps -s 32 intvg hdisk1
mkuser       ## Creates a new user account.
        mkuser id=1004 pgrp=dbadm groups=dbadm home=/home2/db2inst1 core=-1 data=-1 stack=32767 rss=-1 fsize=-1 db2inst1
mkvg          ## Creates a volume group.
        mkvg -f -y llvg -s '32' hdisk1

## GPFS Commands:
mmconfig -n hostShortNames -A -C set1
        mount -t mmfs
        mmfsadm dump pgalloc | more
        mmfsadm dump cfgmgr | more
        mmfsadm dump config | grep comm_
        mmlsmgr
        mmcrvsd -F DISK2SA
        for node in 01 02 03 04 05 06 07 08; do
            mmaddnode c696n$node
            dsh -w c696n$node '/usr/lpp/mmfs/bin/mmstartup'
        done
        dsh -vN 123 /usr/lpp/mmfs/bin/mmshutdown
        # create discripter file - disk-file
        integer i=2
        while [[ $i -le XY ]]; do
            echo hdisk$i:c695n15:::
            i=i+1
        done
        mmcrvsd -F disk-file       ## create vsd, step 8 failure is normal
        dsh -vN f123 startsrc -s mmfs
        dsh -vN f123 'chmod 666 /dev/gpfs*'           ## necessary to get the correct permissions
        /usr/lpp/mmfs/bin/mmcrfs /gpfsxx /dev/gpfsxx -F DISKXX -B 256k -v no      ## Create gpfs file system
        mmfsadm help                ## call mmfs (gpfs) for help
        mmfsadm dump all | grep quorum                  ## check quorum from mmfs dump
        mmfsadm dump waiters                                ## check waiters for mmfs
        mmfsadm dump tscomm                               ## check mmfs inter node communication
        mmlsnode -a
        mmlsdisk gpfs1
        mmrestripefs gpfs1 -b                                  ## rebalance GPFS
        mmadddisk                                                 ## add a vsd disk to gpfs file system

more or page    ## Displays the contents of files one screen at a time.
mount         ## Makes a file system available for use.
        mount nimbus:/resources/lppsource/510 /mnt
mpcc_r -O -o mpi_cuser mpi_cuser.c        ## compile into multi-thread mpi applications.
mv              ## Moves files.
        mv lij lij.`date +"%d%h%y"`

N

netperf
        lslpp -al 'netperf*'
        netperf -s 655360 -S 655360 -r 1024 -l 10 -R -t TCP_STREAM -H c695sn02:4
        netperf -s 655360 -S 655360 -r 512 -l 10 -R -t TCP_STREAM -H c695sn02:4
        export PATH=$PATH:.:/usr/local/netperf
        cd NETPERF
        netperfcfg.sh -i css0 host0
        netperf -s 655360 -S 655360 -r 4096,8192 -l 10 -R -e -t TCP_STREAM -H c695sn02
        netperf -s 655360 -S 655360 -r 4096,8192 -l 10 -R -t TCP_STREAM -H c695sn02
        netperf -s 655360 -S 655360 -r 4096,8192 -l 10 -R -t TCP_STREAM -H c695sn02
        netperf -s 655360 -S 655360 -r 4096,8192 -l 10 -R -e -t TCP_STREAM -H c695sn02
netstat -i     ##  give internet status.
netstat -rn    ##  give internet status.
netstat -in

## NFS auto mount:
        vi /etc/auto/maps/auto.u
        stopsrc -g autofs
        /etc/auto/startauto
nfso                                       ## Configures Network File System (NFS) network variables.
nfsstat                                    ## Displays the nfs status data
ngcreate -n 17-48 llperf         ## Create node groups
nglist        ## list node group
nice                                       ## Runs a command at a lower or higher priority
node_number                        ## /usr/lpp/ssp/install/bin/node_number, get the node number from a SP cluster.
no -a                                     ## network options
no -o tcp_mssdflt=1448
no -o sb_max=163840
no -o ipforwarding=1
no -o tcp_sendspace=65536
no -o tcp_recvspace=65536
no -o udp_sendspace=32768
no -o udp_recvspace=65536
no -o tcp_pmtu_discover=0
no -o udp_pmtu_discover=0
no -o ipqmaxlen=100
nohup                                   ## Runs a command without hangups.

O

odmget -qname=vgraw7 CuAt |pg
oslevel                                ## get the os level

P

passwd                   ## changes a user's password
paste                       ## Joins lines from one or more files.
pg                           ## view a file, similar to "more"
ping <hostname>     ## ping a system
        ping -s 216 c360-6m1_2
        ping -s 217 c360-6m1_2
        ping -s 218 c360-6m1_2
        truss ping -s 215 c360-6m1_3
        ifconfig en0
        traceroute c360cw
        ping loopback
        ping -f loopback
        ping -f -s 1000 loopback
poe /u/loadl/dwspeck/bin/btat -t 4 -d 180 -m 100000 -v -ilevel 6
        unset MP_PROCS
        export MP_TASKS_PER_NODE=16
        export MP_NODES=4
        export GANG_SCHEDULER=enabled
        export MP_EUIDEVICE=csss
        unset MP_CONTROL_WORKSTATION
        export MP_EUIDEVICE=us
        export MP_EUILIB=us
        export MP_NODE_USAGE=shared
        export MP_RESD=yes
        export LIBPATH=/u/dwspeck/GangDS/halfix2:LIBPATH
        export LIBPATH=/u/loadl/dwspeck/halfix:LIBPATH
        export PATH=/usr/lpp/LoadL/full/bin:$PATH
printf                         ## Writes formatted output.
prof                         ## Displays object file profile data.
prtconf | pg               ## print system configurations
ps                             ## Shows current status of processes.
ps -ef
ps -fu tpcd
pstat -S                    ## get STATUS OF PROCESSORS
pstat -T                    ## Interprets the contents of the various sys tables

Q

quota                       ## shows the quota for a user

R

/usr/lpp/ssp/css/rc.switch                  ## run switch: initialize switch
rcp                          ## remote copy: Transfers files between a local and a remote host or between two remote hosts.
read                        ## Reads one line from standard input.
readvgda hdisk399 |pg
readvgda hdisk399 | grep pv_id
reboot                    ## Restarts the system.
reducevg                ## Removes physical volumes from a volume group.
ripquery -d `hostname`     ## Routing Information Protocol
rlogin                     ## rsh, remote login
rpm -Uvh <package_name.rpm>      ## Install Linux packages
rpm -qa |grep -i gd
rm                         ## remove a file
rmdir <dir>            ## dir must be empty
rmdev
        rmdev -dl hdisk103
        for i in `cat DISKFILE13`; do
            rmdev -l $i
            chdev -l $i -a max_coalesce=262144
            mkdev -l $i
        done
rmfs                      ## removes a file system
rmlv                      ## removes logical volume
rmlvcopy               ## removes logical volume copy
rmps                     ## removes a paging space
rmuser                   ## removes a user
rpcinfo                  ## Reports the status of Remote Procedure Call (RPC) servers.
rsh
 
 

S

## SDR Commands:

SDRGetObjects -x switch_responds switch_responds1= =0 | wc -l
SDRGetObjects -x switch_responds switch_responds1= =1 | wc -l
SDRGetObjects -x switch_responds switch_responds0= =1 | wc -l
SDRGetObjects -x switch_responds switch_responds0= =0 | wc -l
SDRGetObjects -x host_responds host_responds= =0
SDRGetObjects -x host_responds host_responds= =1
SDRGetObjects Node | more
SDRGetObjects Node node_number reliable_hostname
SDRGetObjects Adapter node_number adapter_type= =css0 netaddr
SDRGetObjects switch_responds node_number switch_responds0 switch_responds1
SDRListClasses
SDRGetObjects Network
SDRGetObjects Node_control
SDRListFiles
SDRRetrieveFiles mmsdrcfg1 /tmp/mmsdrcfg1.1
SDRChangeAttrValues switch_responds isolated=0 isolated0=0 isolated1=0
SDRGetObjects switch_responds switch_responds0 switch_responds1

s1term -w 2 9       ##  For SP nodes, serially login to node 9 of frame 2.  Block all other logins.
sar -P ALL -u'' 1 1
sar -P ALL 1 1     ## check node cpu status
schedtune             ##  /usr/samples/kernel/schedtune
sed                       ## Provides a stream editor.
        vg1=`sed -n "1p" $diskfile`
        vg2=`sed -n "2p" $diskfile`
        vg3=`sed -n "3p" $diskfile`
        vg4=`sed -n "4p" $diskfile`
setclock c695s     ## set the clock of a node to that of the control workstation
shutdown -Fr now  ## shut down and restart AIX system
size                      ## Displays the section sizes of the Extended Common Object File Format (XCOFF) object files.
sleep                    ## Suspends execution for an interval.
smit
smitty devices
sort                     ## Sorts files
        Report -view DefectView -where "originLogin in ('lij')" |sort +1
spell                    ## Finds English Language spelling errors.
splstdata -a          ## Adapter data
splstdata -b          ## Boot/install data
splstdata -e          ## Site environment data
splstdata -f           ## Frame data
splstdata -n          ## Node data
splstdata -p          ## SP Security settings
splstdata -s           ## Switch data
splstdata -x          ## SP Expansion I/O data
splst_versions -t -n0
splst_versions -t -G
spmon -d|more
spmon -G -d|more

## SSA commands:
ssa_ela                 ## Check ssa adaptor errors.
ssa_diag -l ssa1
ssaraid -Izl ssa0
ssa_speed -a ssa1 -p A
        ssa_speed -x
        for i in 0 1 2 3;do
            for p in A B; do
                ssa_speed -a ssa$i -p $p
            done
        done
        ssaraid -Izl ssa54 |grep pdisk|awk '{print $1}' |while read line;do
            echo "$line speed: \c"
            ssa_speed -l $line -s
            echo
        done
        /usr/ssa/ssaraid/bin/ssaraid.smit rmssaraid_hdr_cmd_to_exec  -l 'ssa0' -n '87953C6971EE4CO'
        /usr/ssa/ssaraid/bin/ssaraid.smit rmssaraid_hdr_cmd_to_exec  -l 'ssa1' -n '87953C6C3EF54CK'
        /usr/ssa/ssaraid/bin/ssaraid.smit chgssadisks_hdr_cmd_to_exec  -l 'ssa0' 'pdisk0 pdisk1 pdisk2 pdisk4 pdisk5 pdisk6 pdisk7 pdisk8 pdisk14 pdisk15 pdisk16 pdisk20 pdisk21 pdisk22 pdisk23 pdisk24' '-a use=free -u'
        /usr/ssa/ssaraid/bin/ssaraid.smit mkssaraid_raid_5_cmd_to_exec  -l 'ssa0' 'raid_5' 'pdisk0 pdisk1 pdisk2 pdisk4 pdisk5 pdisk6 pdisk7' -a strip_size='128' '-a spare=true -a spare_exact=false' -a spare_preferred='false' -a allow_page_splits='true'
        ## ssa disk/adapter microcode link:  http://www.storage.ibm.com/hardsoft/products/ssa/rs6k/index.html
        ssaraid -l ssa38 -I |grep invalid_strips
        ssaraid -l ssa10 -n hdisk133 -I
        ssaraid -l ssa8 -H -n 82703CA341184CG -a use=system -k hdisk999 -d
        ssaraid -l ssa8 -n 82703CA341184CG -I
        ssaadap -l pdisk229
        maymap -dssa0 -ltph
        lqueryvg -Atp hdisk18
        diag -d hdisk18
        ssa_diag -l ssa21 -a
        ssaraid -l ssa8 -H -a split_resolution=secondary -n 82703CA341184CG
        ssaraid -l ssa8 -H -n 82703CA341184CG -a use=system -k hdisk999 -d
        ssa_rescheck -l <hdisk_name>                ## check hdisk reserve state

ssaxlate -l hdisk1     ##  translate hdisk to pdisk and vise versa
ssaxlate -l pdisk101
stat                        ## get the time stamps of a file
stopsrc                  ## stops a subsystem, a group of subsystems, or a subserver.
su - junshan           ## Switch user
svmon -G              ## check global memory status.
svrmgrl                  ## Oracle server manager command
sync                      ## Updates the i-node table and writes buffered files to the hard disk.
sysdumpdev          ## Changes the primary or secondary dump device designation in a running system.
syspar_ctrl -D       ## Delete and restart the group services in right order:
syspar_ctrl -A       ## Start group services
syspar_ctrl -k        ## kill syspar_ctrl daemons
syspar_ctrl -s        ## start syspar_ctrl daemons

T

tail                      ## Writes a file to standard output, beginning at a specified point.
        tail -f nohup.out
talk                    ## Converse with another user.
tar                     ##  Manipulates archives.
        tar -cvf xyz.tar xyzDir  ## make the directory xyzDir into a tar file
        tar -xvf xyz.tar             ## untar the tar file
tcpdump -s600 -i en0
tee                     ## Displays the output of a program and copies it into a file.
tn, telnet            ## Connects the local host with a remote host, using the Telnet interface.
test                    ## Evaluates conditional expressions.
time                   ## Prints the time of the execution of a command.
topas                 ## A utility to moniter cpu, memory, disk, network usage of a system.
touch                 ## Updates the access and modification times of a file.
tprof <program>
        example: tprof stack
        xlC -g tprofTest1.cpp -o tprofTest1
        tprof -x sleep 60
        tprof -dekp tprofTest1  ## This will produce clock ticks for each line.
tr                        ## Translates characters.
trace -adf j238,hook_list -C all -o trace_file -T tsize -L lsize
trace -adf -o trace.log -j 000,001,002,003,005,006,234,106,101,104,10C,134,139,00A,465,10b,45b -C all -T 20000000 -L 40000000
trcrpt                   ## Formats a report from the trace log.
trcstop                 ## Stops the trace function.
traceroute c360cw
true or false          ## Returns an exit value of zero (true) or a nonzero exit value (false).
tty                        ## Writes to standard output the full path name of your terminal.
 

U

ulimit -a                ## check user limits.  To change the ulimits, vi /etc/system/limits, re-login.
umask                  ## Displays or sets the file mode creation mask.
umount or unmount  ## Unmounts a previously mounted file system, directory, or file.
unalias                  ## Removes alias definitions.
uname                  ## Displays the name of the current operating system.
uncompress          ## Restores compressed files.
uniq                     ## Reports or deletes repeated lines in a file.
uptime                  ##  Display the uptime of the system
 

V

varyonvg <vg_name>
varyonvg -n vgraw8
varyoffvg
        for i in `cat VG11`; do
            varyoffvg $i
            exportvg $i
        done
vi                          ## a visual editor
        ## regular expressions: substitute from " on " to the end of line:
        'a,'b s/ on \([a-z0-9., ()_]*\)//g
        'a,'b s/ on \([a-z0-9., ()_]*\);$/;/g
view                     ## read only vi
vmstat                  ## reports system status
vmstat -s | more   ## Reports virtual memory statistics.

## vmtune parameters:

/usr/samples/kernel/vmtune -R 64 -F 2944 -Q64 -u 16 -y 1
/usr/samples/kernel/vmtune -R 64
/usr/samples/kernel/vmtune -F 2944
/usr/samples/kernel/vmtune  -Q 64 -u 16 -y 1
/usr/samples/kernel/vmtune  -Q 64
        vmo -o memory_affinity=1
        vmo -r -o memory_affinity=
        chmod 4755 schedtune

## vsd commands:
        lsvsd
        nn=`/usr/lpp/ssp/install/bin/node_number`
        vsdvg -g vsdllvg$nn llvg $nn
        defvsd gpfslvn$nn vsdllvg$nn vsd.gpfslvn$nn nocache
        cfgvsd -a
        /usr/lpp/csd/bin/cfgvsd vsd.gpfslvn01
        statvsd
        dsh -av lsvsd -l|dshbak -c|more
        dsh -vN f123 /usr/lpp/csd/bin/ha.vsd stop
        dsh -vN f123 '/usr/lpp/csd/bin/ha.vsd start'
        vsdatalst                ## Query for vsd data characteristics
        /usr/lpp/csd/bin/vsdatalst -g        ## list defined global volume groups
        /usr/lpp/csd/bin/vsdatalst -n        ## list defined vsd nodes
        /usr/lpp/csd/bin/vsdatalst -v        ## list defined vsd's
        ctlvsd -l on ## to use KLAPI
        vsdnode 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 css0 512 512 256 48 4096 65536 66 61440        ## Make nodes 17 - 48 vsd nodes
 

W

w                       ## Prints a summary of current system activity.
wait                   ## Waits until the termination of a process ID.
wall                    ## Writes a message to all users that are logged in.
wc                      ## Counts the number of lines, words, and bytes or characters in a file.
what <file>          ## Displays identifying information in files.
whereis                ## Locates source, binary, or manual for program.
whereis cc          ## Locate c compiler
whence mpxlf_r  ## similar to which
which xlC
who
whoami
 

XYZ

xinit                    ## initialize common desk top for AIX os system
xlC                     ## AIX C/C++ compiler
        ### xlC license:
        /etc/ncs/glb_site.txt
        -qnolm       ## Compiling without c/c++/fortran license
 

xhost +ppsclnt9.pok.ibm.com

##  To debug a program, use
        xlC -g <source file> ## to compile
        dbx <executable file> to debug
        ## To compile into a 64-bit applications, use -q64 flag.
        Deal with bigdata and use large amount of memory:
        compile with -bmaxdata:0x8000000 option

yes                        ## Give affirmative response to a command
        time yes| fsck /rawdata00007
zcat                       ## Expands a compressed file to standard output.