How to tell which Linux partition a directory is on?

This is really simple. First of all, you need to know the full path to that directory. “cd” into that directory and type:

and it will display full path of the directory you are in. Remember that or even better, copy it to the clipboard. Type the following command to know the name of the partition:

where replace with the full path of your directory. This in my case becomes “df /data/android/sample“.

If you are already in the directory, you can type “df .” and it will give details about the partition you are currently on.

The output should be something like:

The highlighted part is the name of your partition.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.