Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Is there a command to tell what type of filesystem you're using?

share|improve this question
Possible duplicate: (Yes it's newer, but it has a) an accepted answer and b) also works for unmounted filesystems and image files) – Tobias Kienzler Nov 2 '12 at 6:57
It would help for the target operating system(s) to be specified. Most of the answers assume it is Linux but this isn't stated in the question. – jlliagre Nov 2 '12 at 10:03

9 Answers 9

Get an overview of your storage using lsblk and then get the file system type for the device you're interested using something like fsck -N /dev/sda1 (you don't need to have superuser powers to use this command).

This is useful if your file system is in a LVM volume, since lsblk won't tell you what file system is in there.

share|improve this answer

Just use blkid -o value -s TYPE "$DEV", it also works for unmounted devices or even image files.

share|improve this answer

cat /etc/mtab for mounted filesystems.

share|improve this answer
$ stat -f -c %T /
$ stat -f -c %T /boot
$ stat -f -c %T /srv
$ stat -f -c %T /tmp
share|improve this answer
If it matters, I believe this is specific to Linux. – Chris Down Mar 21 '12 at 14:17

Your question can be taken several ways. Literally Karlson's answer is pretty cool because it tells you the filesystem of the volume | partition that you are currently on.

df -hT I have always liked this command because it shows you all the "standard" filesystems that are mounted and does it in human-readable size format.

However, you may have other disks or volumes that are not mounted (commented out), failed to mount, or have been unmounted. Another thing you can do is to run cat /etc/fstab this will show you the "filesystem table" and list the filesystems that are supposed to be mounted on boot along with the location, filesystem type, mountpoint, and more.

share|improve this answer
df -T . | awk '{ getline ; print $2 }'
share|improve this answer

You can also use lsblk -f and blkid to get information about your filesystems and their properties.

share|improve this answer

Run df ., which will tell you on what filesystem the current directory resides. Then run mount, which will produce a list of mounted filesystems along with their types and mount options. This works for me:

mount | fgrep -w "`df . | grep '%' | sed -e 's/.*% *//'`"
share|improve this answer

If you do:

df -k .

It will tell you what filesystem your current directory is on.

share|improve this answer
df . is enough for this. And, if you need to know the filesystem type, df -T . will do. – Alexios Mar 20 '12 at 22:29
To see the partition of some specific file check here. – Ayush Goyal Mar 21 '12 at 14:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.