List Pen Drives on Linux lazarus / 32-Linux ---------------------------------------------------------------------- junioraxis · 2021-02-01 22:44 Would anyone know how I can list the connected flash drives, this on Linux? I researched in the brazilian community  and had no answers. And would it be possible to know the storage size of this flash drive? ---------------------------------------------------------------------- Leledumbo · 2021-02-03 19:25 There are multiple ways, but all involves parsing external programs output. The most reliable one I think is the output of `usb-devices`. This command takes no argument and will print every attached USB devices, all you have to do is parse and find one(s) with Driver=usb-storage. The simplest one would be the output of `df -B1`. Not only you get the disk size, but also its usage and free size. All you need to know is where your distro mounts external drives. In *buntu family, it's usually /media//. In Arch derivatives, it's /run/media//. So I think you can add a little grep into the mix: df -B1 | grep /media/. Might be a little problematic if it's mounted as //media/, hence it's a little unreliable. There are other variants as well, just find the one that you can work with the best.