Wednesday, February 25, 2009

List for Unix Commands (Solaris and AIX)

There is a page which provides a nice guide on Solaris here. Here is a sample info:

df -n (or fstyp device) show type of file system (ufs/vxfs)
fuser and pfiles open files
prtconf -V OBP level
pgrep, pkill, prstat -a process info and manipulation
logins -p|-d local users without passwords | duplicate uids
mpstat, prtdiag, psrinfo -v processor information and more
traceroute since Solaris 7
troff -man man.1 | dpost | lp print old style man pages
sgml2roff lpfilter.1m | troff -man | dpost | lp print sgml (new) man pages
fstyp -v list superblock including minfree %
tput nice screen output
what, ldd, strings information about binaries
ctrl-V in vi insert control character
ftp> get README | more
ufsdump 0f - /filesystem | (cd /mnt; ufsrestore rf -); rm /mnt/restoresymtable dump restore pipe
echo \007 get bell to ring
comm common (non-common) lines from two files
pkgchk -lp /usr/bin/ls which package does ls belong to?
df -oi -F ufs free inodes
icheck -b blockno filesystem block to file mapping
dircmp, rsync, filesync compare directories, sync utilities
nohup /var/tmp/myscript.ksh > /var/tmp/myscript.out & for things which have to complete (no risk of terminal being logged out)
netstat -pn arp like output when name services are down
pwdx, pldd, ptree and more in /usr/proc/bin
uname -X basic system information - one item on each line (useful for scripts)
read read a line
listusers another way of listing users
tcopy copy tape
nfsstat -m (or check /etc/rmtab) current nfs mount
clear_locks clear nfs locks
df -h, du -h, ls -lh since Solaris 9 - output in powers of 1024

There is also another site which allows you to search various commands within different operating system. Unfortunately, you need to know the key word to search.

Here is another reference useful for Solaris.

This one is not as good but have some information I did not see above.

Here is a quick Reference for AIX.

A similar list for AIX so there might some overlap here.

Alternatively, you can refer to the AIX 4.3 reference book here.

Another good source for AIX information is from IBM's own System Magazine.

Finally, here is a chart of the various commands in different Unix platforms:

Saturday, February 14, 2009

Getting your virtual path

Sometimes we need to obtain the virtual path to our page to pass into 3rd party applications. This can easily be done in by using


However, if you are using asp classic, you will need some additional more coding. This is one way of doing it:

dim vUrl, arrStr, vStr
dim loopCnt
vUrl = Request.ServerVariables("PATH_INFO")
arrStr = Split(vUrl, "/")
vStr = "/"

for loopCnt = 0 to UBound(arrStr) - 1
if Len(vStr) > 1 then
vStr = vStr & "/"
End If
vStr = vStr & arrStr(loopCnt)