From: sfehrman@fire.central.sun.com (Scott Fehrman SE Northern IL)
Newsgroups: comp.sys.prime
Subject: Primos LD for UNIX
Date: 16 Dec 1992 22:48:34 GMT
Organization: Sun Microsystems, Inc.
Distribution: world
Reply-To: sfehrman@fire.central.sun.com
NNTP-Posting-Host: fire.central.sun.com



Dear Fellow UNIX user ( probably former PRIMOS user ):

   * Do you or other users ever get "fed-up" with how "ls" lists files and
     directories in one bunch?

   * Do you hate having to do a "long list" and look for a "d" in the first
     column to determine what files are actually directories?

   * For those of you who know Primos, do you like the way that it seperates
     the files from the directories and prints the directories pathname?

If you answered YES to any of the above questions I have a utility for you!

"Print Directory" (pd) is an alternative to the famous UNIX command "ls". "pd"
(version 2.10.2) is a program that was written in "C" and has been successfully
tested on SunOS 4.x, EXL300, MIPS/EXL7000 system, and DECStations with ULTRIX.
Print Directory "pd" should work on any UNIX system that the program libraries
and a "C" compiler.

"pd" was created out of discuss with how "ls" treated directories as regular
files. "pd" can be used as a 98% replacement for the "ls" command (I'm sure
there is something that you will still need "ls" for).

"pd", in summary, lists UNIX directories in a more user friendly manner then
what "ls" does. By default, "pd" displays the directory pathname at the
begining of the list along with the total number of entries in the directory.
The quantity of files and file names are displayed second. The quantity of
directories and directory names are displayed last.

With regards to performance, "pd" seems to run almost as fast as "ls" in most
cases. It will take a little longer listing directories if certain options are
used. Compare the samples below that use "ls" and "pd" to list the directory
"/usr/include".

----------------------------------------------------------------------
this is a sample of ls:
----------------------------------------------------------------------

# ls
X11             fstab.h         mon             sbusdev         sunwindowdev
a.out.h         ftw.h           mp.h            scsi            sys
alloca.h        grp.h           nan.h           search.h        syscall.h
ar.h            grpadj.h        ndbm.h          setjmp.h        sysexits.h
arpa            gwin.h          net             sgtty.h         syslog.h
assert.h        images          netdb.h         signal.h        termio.h
auevents.h      kanji.h         netimp          stab.h          termios.h
cadds           key.h           netinet         stand           time.h
cgi_gp1_pwpr.h  kfont.h         nfs             stdio.h         tiuser.h
colorbuf.h      kmac.h          nlist.h         string.h        ttyent.h
ctype.h         ktrans.h        pascal          strings.h       tzfile.h
curses.h        kvm.h           pixrect         stropts.h       ufi.h
dbm.h           lastlog.h       poll.h          struct.h        ufs
debug           link.h          prof.h          sun             unistd.h
des_crypt.h     lofs            protocols       sun2            utmp.h
dirent.h        lwp             pwd.h           sun3            values.h
disktab.h       m68k            pwdadj.h        sun3x           varargs.h
errno.h         machine         ranlib.h        sun4            vfont.h
exportent.h     make            rasterfile.h    sun4c           vfork.h
f77             malloc.h        regexp.h        sundev          vm
fcntl.h         math.h          resolv.h        sunif           xview
floatingpoint.h memory.h        rpc             suntool
frame.h         mntent.h        rpcsvc          sunwindow

----------------------------------------------------------------------
this is a sample of "pd":
----------------------------------------------------------------------

# pd

/usr/include           113 Entries.

74 Files.

a.out.h             alloca.h            ar.h                assert.h
auevents.h          cgi_gp1_pwpr.h      colorbuf.h          ctype.h
curses.h            dbm.h               des_crypt.h         dirent.h
disktab.h           errno.h             exportent.h         fcntl.h
floatingpoint.h     frame.h             fstab.h             ftw.h
grp.h               grpadj.h            gwin.h              kanji.h
key.h               kfont.h             kmac.h              ktrans.h
kvm.h               lastlog.h           link.h              malloc.h
math.h              memory.h            mntent.h            mp.h
nan.h               ndbm.h              netdb.h             nlist.h
poll.h              prof.h              pwd.h               pwdadj.h
ranlib.h            rasterfile.h        regexp.h            resolv.h
search.h            setjmp.h            sgtty.h             signal.h
stab.h              stdio.h             string.h            strings.h
stropts.h           struct.h            syscall.h           sysexits.h
syslog.h            termio.h            termios.h           time.h
tiuser.h            ttyent.h            tzfile.h            ufi.h
unistd.h            utmp.h              values.h            varargs.h
vfont.h             vfork.h

39 Directories.

X11                 arpa                cadds               debug
f77                 images              lofs                lwp
m68k                machine             make                mon
net                 netimp              netinet             nfs
pascal              pixrect             protocols           rpc
rpcsvc              sbusdev             scsi                stand
sun                 sun2                sun3                sun3x
sun4                sun4c               sundev              sunif
suntool             sunwindow           sunwindowdev        sys
ufs                 vm                  xvi

----------------------------------------------------------------------

"pd" has many options:

Print Directory ( an alternative to 'ls' ).

Options:

       -a   | -all       ...   show all entries ( include '.' & '..' ).
       -b   | -brief     ...   same as '-nh -np -nq' & no blank lines.
       -c   | -count     ...   show counts only.
       -d   | -dir       ...   directories only.
       -f   | -file      ...   files only.
       -h   | -help      ...   help information.
       -l   | -link      ...   if symbolic link, show links status
       -p   | -pro       ...   file protection (owner,group,other).
       -r   | -reverse   ...   sort entries in reverse order.
       -s   | -size      ...   file size.
       -v   | -version   ...   version stamp.
       -w   | -wide      ...   wide format output ( 132 columns ).
       -np  | -no_pwd    ...   don't show pathname.
       -nq  | -no_qty    ...   don't show quantities.
       -ns  | -no_sort   ...   don't sort the files/directories.
       -sc  | -sglcol    ...   force single column output.
       -det | -detail    ...   all date/time options.
       -dta | -accessed  ...   date/time accessed.
       -dtm | -modified  ...   date/time modified.
       -dts | -status    ...   date/time status changed.

Usage: pd  <options>  <list of files/dirs>


----------------------------------------------------------------------

How to obtain "pd":

If there is intrest, i'll do one of two things; a: email to those who ask or
b: post the utility on the newsgroup if there is A LOT of intrest  :)

scott.fehrman@Central.Sun.Com    ( former PRIMOS user )

Scott L. Fehrman
Sun Microsystems Inc.
Itasca, IL. 60143
(708) 285-7632

Let me know what you think

Newsgroups: comp.sys.prime