I prefer to work as much as possible at the command line. There's this neat trick that Nautilus does that ought to be do-able from the command line, but I can't figure out how.
I plug in an external disk into my USB port. It has an exFAT partition with the name "200503exfat". I gave the partition that name, if I remember correctly, using the macOS Disk Utility app. I want to mount the partition in Linux, and I want to use the partition name as the mount point name. I can do that like so:
$ lsblk | grep sd
sda 8:0 0 931,5G 0 disk
├─sda1 8:1 0 200M 0 part
└─sda2 8:2 0 931,3G 0 part # Must be this partition. What's its name?
$ sudo mkdir /media/myusername/200503exfat # I happen to know the name but I...
$ sudo mount /dev/sda2 !$
sudo mount /dev/sda2 /media/myusername/200503exfat #...don't want to hard code it.
FUSE exfat 1.2.8
$
I want to put this into a bash script, but I want the script to DISCOVER the partition name (here 200503exfat). And there's the rub. If I fire up Nautilus, bingo, I see the name "200503exfat" in the left pane. So if Nautilus can do it, it ought to be do-able at the command line, right?
This seems like a question asked a zillion times before, but I can't find the answer. I've looked at lsblk, fdisk, sfdisk, parted ... and of course google.
TIA.
P.S. For optional extra credit ... how does Nautilus know that /dev/sda2 is mountable but /dev/sda1 is not?