There are several ways to determine the filesystem type in Linux. Some of the most common ways are:

Method 1: Using the lsblk command

The lsblk command is a command-line utility that displays information about the block devices on your system, including the filesystem type. To display the filesystem type of a particular block device, you can use the -o option with the lsblk command to specify the information you want to display. For example, to display the filesystem type of the /dev/sda block device, you can use the following command: This will display the filesystem type of the /dev/sda block device. To get the details of the specific device like: /dev/sda3. You can also remove the header section from the result with --noheadings option. This is helpful for writing the shell scripts.

Method 2: Using the df command

The df command is a command-line utility that displays information about the filesystems on your system, including the filesystem type. To display the filesystem type of a particular filesystem, you can use the -T option with the df command. For example, to display the filesystem type of the / filesystem, you can use the following command: This will display the filesystem type of the / filesystem, as well as other information about the filesystem, such as the total size, used space, and available space.

Method 3: Using the mount command

The mount command is a command-line utility that displays information about the filesystems that are currently mounted on your system, including the filesystem type. To display the filesystem type of a particular filesystem, you can use the mount command without any options. For example, to display the filesystem type of the / filesystem, you can use the following command: This will display a list of all the mounted filesystems on your system, along with their mount points and filesystem types. I hope this helps! Let me know if you have any questions.

Conclusion

In conclusion, there are several ways to determine the filesystem type in Linux, such as using the df command, the mount command, and the lsblk command. These utilities provide different ways to display information about the filesystems on your system, including the filesystem type. Understanding how to use these utilities can be helpful in various scenarios when working with filesystems in Linux.