Re: is there a util, or can findmnt be enhanced...(RFE?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 11, 2021 at 12:44:01PM -0800, L A Walsh wrote:
> I see 'findmnt' shows a mount if you specify the mount point.
> 
> Given the name, I was surprised it didn't already do
> this: I was wondering if it could find
> the mount point of a file or pathname I give to it?
> 
> So if I am in /home/cache/suse, and type:
> 
> >  findmnt .
> 
> it would tell me something like:
> 
> /home[cache/suse] /dev/Space/Home
> 
> meaning:
> MNTPOINT[offset_path]  <device>


 $ pwd
 /home/projects/util-linux

 $ findmnt --target .
 TARGET SOURCE         FSTYPE OPTIONS
 /home  /dev/nvme0n1p2 ext4   rw,relatime


 man page:

     -T, --target path
              Define the mount target.  If path is not a mountpoint
              file or directory, then findmnt checks the path elements
              in reverse order to get the mountpoint (this feature is
              supported only when searching in  kernel  files  and
              unsup‐ ported  for  --fstab).  It's recommended to use
              the option --mountpoint when checks of path elements are
              unwanted and path is a strictly specified mountpoint.


 I'll prove the beginning of the man page to make this feature more
 obvious.

   Karel


-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux