Site hosted by Angelfire.com: Build your free website today!
UNIX

UNIX

Links

UNIX Man Pages
Shell Differences
AIX Commands List
Top man page
Awk Book


AIX

AIX Manuals

List Logical Volumes;

   lsvg

Show machine attributes on AIX;

    lsattr -El sys0

The "realmem" row will give the amount of physical RAM in kbytes

Also:

'bootinfo -r'

Monitor:

    'topas -?' and 'monitor -?'

Most active CPU:

    ps -ef | sort -rn +3 | more

Network:

    netstat -in

look in the Ierrs and Oerrs columns for excessive error rates. Also:

    entstat -d

Paging Space:

    lsps -a

Output may look like:

Page Space Physical Volume Volume Group Size %Used Active Auto Type
hd61 hdisk26 rootvg 1024MB 0 no no lv
hd6 hdisk0 rootvg 2560MB 23 yes yes lv

Also:

    lsps -s

Giving:

Total Paging Space Percent Used
2560MB 24%

If the percentage used multiplied by the total paging space is greater then the physical RAM then the system is paging. Remember to get the units right!

vmstat:

If the "r" column is greater than 3 (three) then the run queue is excessive and processes are being blocked from execution.
if the "b" column is greater than 3 (three) then this indicates an I/O bottleneck.
If the "pi" and "po" are consistently non-zero this indicates thr level of paging - the higher the numbers the worse things are.
If "us" and "sy" add up to greater than 90% then the box is CPU bound.
If "wa" is greater than 40% then the box is I/O bound. (it may be paging,it may not....)

iostat:

    iostat -d 5

This will give you some indication of disk activity. Note which disks are being "hit" the most. If they correspond to the paging disks then the system is paging (duh). You may be able to relate disks to Oracle tables also.

Awk

To specify a special character in awk, see the following example;

df -Ik 2>/dev/null |egrep "^/" | awk '
{ printf("%s\n (\47%s\47, \47%s\47, \47%s\47, ", ins, sysdate, host, $1 ) printf("%s, %s, %s, \47%s\47);\n", $2, $3, $4, $6 )
}' ins="$insf" sysdate=$sysdate host=$host >> $STATS_FILE

cd

cd -

Command Line

Only run the second command if the first one worked;

    cmd1 && cmd2

Send standard error to standard output;

    2>&1

Another Notation for execution a command other than `` is using (). e.g.;

     echo $(ls)

Crontab

Format;

    minute hour monthday month weekday command

H3>Dump

To see what shared libraries are linked to an executable:

    dump -H <exe>

expr

counter=1
counter=`expr $counter + 1 `
echo $counter

Grep

Grab a range of lines;

    grep -p

FTP

To change local working directory:

    lcd

To chmod a file using DOS ftp:

    quote site chmod 755 <filename>

Ls

Switches I never use;

    "ls -L" to follow a link

    "ls -p" put a slash after directories

    "ls -1" single list

IP address

To display ip address;

     /usr/sbin/ifconfig -a

Minus Data

To produce the minus of one file compared to another you can use the following;

     comm -3

comm produces 3 column output - data unique to file one, data unique to file two, and data common to both files. In may be that just suppressing the output of column 3 does the trick.

mkdir

mkdir -p

Sort

To sort by the third field and define it as a numeric;

    ps -ef | sort +3n

Stty

To switch off the echo of a password:

    stty -echo

Telnet

To telnet a Port:

telnet
GET /

e.g.:
telnet essun5.es.oracle.com 7777
Trying 144.20.1.16...
Connected to essun5.es.oracle.com.
Escape character is '^]'.
GET /
<HTML><tHEAD><TITLE>Test home page</TITLE></HEAD>
<BODY><P>This is the home page</P></BODY></HTML>
Connection closed by foreign host.

Tr

Lowercase a string;

  &nbp;  tr '[A-Z]' '[a-z]'`

Windows

To access the Registry enter at the DOS prompt;

    regedit

uuencode

cat filename | uuencode attachmentfilename | mailx -s subject email@address

ex.

cat /tmp/file | uuencode somefile.txt | mailx -s test mark.charlton@capgemini.co.uk

to mix text as body and text/data as a file:

(cat bodytext ; cat file | uuencode attachmentfilename ) |

mailx -s subject email@address