Today is going to be a good day if you have decided that you want to show your filesystem in the Linux terminal. If that’s not what you want to do, this might not be the article for you! If it is what you want to do, read on!
I’m going to try to keep this fairly short. There are two commands that I have available to help you show your filesystem in the Linux terminal. There are surely other ways to do so, but I’ll just cover two different ways.
Both of them will be quite simple…
These two commands should be fairly standard. They should work in your distro, regardless of which distro you’ve chosen. There’s nothing special about them.
What do I mean when I say ‘show your filesystem in the Linux terminal’? I mean you can see, and identify, your various drives and their partitions. You can also learn a bit more information about them, but the general idea is that you can see and learn about them in the terminal.
Like I said, this won’t be fairly complicated. It will involve the terminal.
Show Your Filesystem In The Linux Terminal:
Yes, I said the terminal. You will need an open terminal. If you want to open your default terminal, you can usually just press
Now, to get to the point… I’m going to show you a couple of commands that you can use to show your filesystem in the Linux terminal.
Ready?
lsblk:
The first tool we’ll use is lsblk. This is installed by default on any major distro and you won’t need to install anything. If you check the man page, you’ll see that lsblk is described like this:
lsblk – list block devices
That command sounds useful. Block devices are disks, drives, partitions, and the like. So, you can just run that command in the terminal. It looks like this:
1 | lsblk |
The output is easy enough to understand. It might look something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | kgiii@kgiii:~$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 476.9G 0 disk ├─sda1 8:1 0 512M 0 part /boot/efi └─sda2 8:2 0 476.4G 0 part / sdb 8:16 0 3.6T 0 disk ├─sdb1 8:17 0 991.1G 0 part /media/kgiii/elements1 ├─sdb2 8:18 0 984.6G 0 part /media/kgiii/elements2 ├─sdb3 8:19 0 976.7G 0 part /media/kgiii/elements3 └─sdb4 8:20 0 773.6G 0 part /media/kgiii/elements4 sdc 8:32 1 14.4G 0 disk └─sdc1 8:33 1 14.4G 0 part /media/kgiii/FLASH DRIVE sdd 8:48 1 58.6G 0 disk └─sdd1 8:49 1 58.6G 0 part sr0 11:0 1 1024M 0 rom |
That’s with a bunch of junk still plugged in from a previous article. You can see that the output is easy enough to understand.
df:
The next command we’re going to use is the ‘df’ command. Again, you shouldn’t need to install anything to use the df command. This is something that should already be installed and if you want to use it to show your filesystem type in the Linux terminal, it’s quite easy.
First, you should check the man page. If you do, you’ll see that df is described as:
df – report file system disk space usage
Once again, that sounds like a fine tool for learning about your filesystem. You’ll want two flags. The first flag is -T and will show you the file system type. The second flag is -h and that means it’ll spit the output in human-readable form. An example of that command would look like:
1 | df -Th |
An example output would look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 | kgiii@kgiii:~$ df -Th Filesystem Type Size Used Avail Use% Mounted on tmpfs tmpfs 1.6G 1.7M 1.6G 1% /run /dev/sda2 ext4 468G 307G 138G 69% / tmpfs tmpfs 7.8G 397M 7.4G 5% /dev/shm tmpfs tmpfs 5.0M 4.0K 5.0M 1% /run/lock /dev/sda1 vfat 511M 28M 484M 6% /boot/efi /dev/sdb4 ext4 761G 604G 118G 84% /media/kgiii/elements4 /dev/sdb1 ext4 975G 904G 21G 98% /media/kgiii/elements1 /dev/sdb2 ext4 969G 705G 215G 77% /media/kgiii/elements2 /dev/sdb3 ext4 961G 537G 375G 59% /media/kgiii/elements3 tmpfs tmpfs 1.6G 3.3M 1.6G 1% /run/user/1000 /dev/sdc1 vfat 15G 14G 929M 94% /media/kgiii/FLASH DRIVE |
Again, that’s nice and easy to understand. If you want to show your filesystem information, these commands are easily memorized.
You’ll notice that both output is quite similar, as it should be. There are only so many filesystems available in the distro I used to write this. This information can be quite a bit more complicated if you’re running it against a NAS with lots of different storage options, but it’s generally easy enough to understand.
Closure:
There you go… This isn’t even a very long article – because it doesn’t need to be. I wanted to show you how to show your filesystem information in the Linux terminal. None of these commands are all that difficult to use and remember. You can also get some useful information from the mount | grep "^/dev" command, so keep that in mind along with the commands shown in this article.
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.