finding the filesystem of a file

Dave Taylor {guest} dt at mathcs.emory.edu
Tue Nov 6 03:43:14 AEST 1990


Curious to know if anyone can tell me the fastest way to find out which
filesystem a given file is on if the entire pathname is given.  I have only
5 filesystems  but I'm stumped as to on how to make sure that I always match
the file with the appropriate filesystem.  i.e. if the files are /u/foo/bar/new
and maybe /u/foobar/new AND the filesystems are /u, /u/foo, and /u/foo/bar.

for the file /u/foo/bar/new, the output should be "/u/foo/bar"
for the file /u/foobar/new, the output should be "/u"

The reason for this is because I backup several filesystems on one tape and I
need to know which filesystem to look in as I search through my log files.

Thanks in advance for all your help.



--david

-- 
-------                                                                 -------
David E. Taylor, OMSS UNIX Development // Operation Mobilization USA
AT&T: (404) 631-0432  +====+  UUCP:    {decvax, sun!sunatl, gatech}!emory!om!dt
FAX:  (404) 631-0439  +====+  Internet: dt%om.uucp at mathcs.emory.edu



More information about the Comp.unix.shell mailing list