commands
findmnt — inspect mounted filesystems
Read-only util-linux command for discovering the filesystem containing a path. --target accepts a file or directory; it may report an ancestor mount, not the exact path. Select explicit output columns for stable interpretation. This command does not mount, unmount or establish retention policy.
Formal Syntax & Structure
linux syntaxlinux
findmnt [OPTIONS] --target PATHParameters & Attributes
| Name | Type | Description |
|---|---|---|
| --target PATH | option | Find the filesystem containing the given path. |
| -n | option | Suppress column headings. |
| -o TARGET,FSTYPE | option | Select the mount target and filesystem type columns. |
Return Value
text and exit status
Reports matching filesystem information; exit status zero on success, one on failure or no matching filesystem.
Working Example
Example Snippetlinux
findmnt -n -o TARGET,FSTYPE --target /tmp