To Index

 Documented in Volume 1 of the UNIX Programmers Manual.


 % cd /usr/ucb
 % whereis -u -M /usr/man/man1 -S /usr/src/cmd -f *
  Finds all the files in /usr/bin which are not documented
  in /usr/man/man1 with source in /usr/src/cmd 

  Another interesting perversion is an alias'd whereis:

  alias wheres ls -l \{'`echo $path \
    | sed "s/ /,/g"`'\}/'`echo \!-0:1 \
    | sed "s/^./[&]/"`'

  It does an ls -l on every file (passed as arg 1) in any directory on
  your current path.  (No aliases, though adding an if at the front
  should do the trick.)  The idea is to turn your $path list into a comma
  separated list, stick that between {}, and append / and arg 1 to that.
  Alas, if the file doesn't exist in one of the directories, you get
  errors from ls saying it doesn't exist in a given directory.  So, arg 1
  is turned into a pattern, which is allowed to fail; the pattern is,
  e.g., foo --> [f]oo.  So the second arg to ls only expands to the
  existing files.

To Index