Given a command that produces a list of numbers, here's how you can sum up/add up that list. echo "a=0\n$(command to produce the list|sed 's/^/a=a+/')\na"|bc This converts the output/input stream to something like a=0 a=a+10 a=a+20 a=a+400 a=a+1200 a which is then piped into the bc command. This results in a single number being output'd, in this case, 1630 For example, to sum up how much space the /dfs/clips directories were using up in Southbury, I had run my pretty_fts_lsfldb.tcl command, putting the output in pretty.out, echo "a=0\n$(grep clips pretty.out | awk '{print $5}'|sed 's/^/a=a+/')\na"|bc -------------------------------------------------------------------------------- A better, cleaner way to do this is to use awk. For example, df -k|awk '{a+=$3} END {print a}' will add up the third word, the "Free" column. Note that you don't have to strip out all the other words, nor even the non-numeric lines as in the title (the word "Free"). Filesystem 1024-blocks Free %Used Iused %Iused Mounted on /dev/hd4 65536 42356 36% 2385 8% / /dev/hd2 1425408 585768 59% 29906 9% /usr /dev/hd9var 262144 194040 26% 287 1% /var /dev/hd3 540672 125532 77% 1504 1% /tmp /dev/hd1 65536 28212 57% 1080 4% /home ... or to add up the size of all the *DAT files, cd /db2data/v4prod/db2mnt/v4patts ls -l *DAT | awk '{a+=$5} END {print a}' returns 1.29692e+10 which is 12,969,200,000 or almost 13GB. -------------------------------------------------------------------------------- To see what's in a library, dump -Tv /local/lib/zlib-1.1.3/libz.a -------------------------------------------------------------------------------- Use the -w switch when diff-ing two files to ignore white space. diff -w ... -------------------------------------------------------------------------------- The maximum file size (file size limit) in a local AIX file system is 2 GB if it's a normal JFS file system, and 64 GB if it's a large file enabled file system. -------------------------------------------------------------------------------- As root, use bootinfo -r to see how much RAM memory a particular machine has. -------------------------------------------------------------------------------- To uppercase something, use dd conv=ucase. For example, to rename everything in your current directory to uppercase, you can try for i in *; do echo mv $i $(echo $i|dd conv=ucase 2>/dev/null); done The 2>/dev/null is to get rid of the 0+1 records in. 0+1 records out. lines. Another example is converting ASCII to EBCDIC (ascii to ebcdic) or vice-versa. dd if=ascii.file of=ebcdic.file conv=ebcdic or dd if=ebcdic.file of=ascii.file conv=ascii -------------------------------------------------------------------------------- To see what maintenance level you're at, try oslevel -r You get back something like 4330-10, which says you're at ML10. Or for AIX 5.2.2, it'll be something like 5200-04 -------------------------------------------------------------------------------- To turn on the Set Group ID bit (e.g. drwxrwsr-x), chmod g+s /dir/name or chmod 2775 /dir/name -------------------------------------------------------------------------------- The hostname of a system is (or can be) different than the uname. uname -S foo Sets the uname uname -n Displays the uname What uses this uname, I'm not sure. We came across it playing around with HAMCP on dncdb3/4. -------------------------------------------------------------------------------- On 1-13-2006 (Friday the 13th), I found that /dev/ipldevice was missing on the dncdb1 & dncdb2 machines in EDC. Don't know why, but bosboot verification kept failing when we tried applying service. 0503-409 installp: bosboot verification starting... 0503-497 installp: An error occurred during bosboot verification processing. ---- end ---- 1800-035 Exit status (13) returned by command. (Command process used stdout and stderr file descriptors connected to SMIT via pipes.) For AIX 5.2, ln /dev/hdisk0 /dev/ipldevice so it looks like this, ls -l /dev/hdisk[01] /dev/ipldevice brw------- 2 root system 14, 2 Mar 24 2005 /dev/hdisk0 brw------- 1 root system 14, 1 Mar 24 2005 /dev/hdisk1 brw------- 2 root system 14, 2 Mar 24 2005 /dev/ipldevice For AIX 5.3, mknod /dev/ipldevice c 23 1 (numbers may vary), so you get ls -l /dev/hdisk[01] /dev/ipldevice brw------- 1 root system 23, 1 Oct 22 05:39 /dev/hdisk0 brw------- 1 root system 23, 0 Oct 22 05:39 /dev/hdisk1 crw------- 2 root system 23, 0 Oct 22 05:39 /dev/ipldevice --------------------------------------------------------------------------------