Sometime I need to find out which conf files (or help file etc)
belongs to a package or from which package a head file comes from etc.
If you know Redhat's "RPM -qa/-qf/-ql" then you know what I mean.
Unfortunately I couldn't find any apps(inc. pkginfo, pkgchk), which
can help me out. Luckily, Sun uses a "text file" for pkgadd's
repository. So let do some sed-grep.
Solaris equivalent of rpm - The following commands are the "add-on"
for pkgadd, pkginfo, pkgchk, pkg*
1) Which packages do I have installed?
ls /var/sadm/pkg |sed 's/[A-Z]\{3,4\}//'| sort -f
2) When did I install them?
ls -ltr /var/sadm/pkg
3) Find all files in "the Apache" package: (one line)
cat /var/sadm/install/contents|grep -v "/usr d"| grep -v "/usr/lib d"
|awk '{n=NF;print $1"\t" $n}' |grep -i apache
4) where does the head file "disasm.h" come from? (one line) (a la
"pkgchk -l -p", my is better because it doesn't need the path:-) )
cat /var/sadm/install/contents|grep -v "/usr d"| grep -v "/usr/lib d"
|awk '{n=NF;print $1"\t" $n}' |grep -i disasm.h
5) All the packages in /usr:
echo -e `grep "/usr d" /var/sadm/install/contents|sed 's/
/\\\n/g'`|tail +7|sort|more
6) All the packages in /usr/lib:
echo -e `grep "/usr/lib d" /var/sadm/install/contents|sed 's/
/\\\n/g'`|tail +7|sort|more
Enjoy
Tuan