2.15.2007

get the timestamp formatted the way you want

ls in HPUX and most other *nix versions just plain sucks giving the output you need.  see the following section of the HPUX ls(1) man page:
           -l   (ell) List in long format, giving mode, number of links,
                owner, group, size in bytes, and time of last modification
                for each file (see further DESCRIPTION and Access Control
                Lists below).  If the time of last modification is greater
                than six months ago, or any time in the future, the year is
                substituted for the hour and minute of the modification
                time.  If the file is a special file, the size field


get the month day year Hour minute second of timestamp of a file (modification):

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=105260&admit=-682735245+1171602387200+28353475

I believe this uses the stat function.

2.13.2007

finding hard links / hard link count in file systems

link column (second column) in ls -l output (hard link count):
a directory will always have a minimum of 2 links.  One for the directory itself and one for the . (current directory) inside the directory.
any additional subdirectories directly under the directory count as an addition link for the directory because of the .. (parent) directory entries inside each subdirectory.


to find hard links:
ncheck -F vxfs /dev/vg00/lvol6 | sort -n | awk '$1==prev{print last;print $0}{prev=$1;last=$0}'