How to find on what partition is a file located

To find out on what partition is a file located, use the df command.

Syntax: df path/to/file

$ df /etc/passwd
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 19609276 3227140 15386040 18% /

To filter the text, in order to get only the partition name, use this command:

$ df /etc/passwd | tail -1 | cut -d' ' -f 1
/dev/sda1

Liked it? Take a second to support Geekster on Patreon!
Tagged with: , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Support LinuxG via Patreon
Support LinuxG.net on Patreon!
Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!