How do I access the contents of an external drive via terminal?

How do I access the contents of an external drive (such as USB drive) via terminal? I know that I can just right click inside the folder and click on “Open Terminal here” but how do I cd into the USB drive (I am not talking about manually mounting the drive)?

I believe I have to access the mnt directory to view all the external drives connected to it.

With terminal command

df -hT

you will see partition info including the mount points of currently mounted drives. Then you can cd to the external drive using the path at the df output.

See more info with command

man df
2 Likes

I like to do that with lsblk, you can try plain:
lsblk
or
lsblk -o MODEL,NAME,LABEL,MOUNTPOINT
which will give you something like this:

MODEL                    NAME   LABEL       MOUNTPOINT
INTEL_SSDSA2CT040G3      sdb                
                         └─sdb1             /
DataTraveler_3.0         sdc    ENDEAVOUROS 
                         ├─sdc1 ENDEAVOUROS 
                         └─sdc2 ARCHISO_EFI 
HL-DT-ST_DVDRAM_GH24NSC0 sr0                
3 Likes

Hello Dear !
There are different cases to apply to this request or question.

Actually i have tried with a bootable USB plugged on my laptop and i simply couldn’t find it in the traditional /media/username or /mnt folders (from terminal) and this can look weird but instead i searched a bit and found that my drive was listed under the /run/media/username

So i did
cd /run/media/unclemez (to access the folder above my USB)
ls (to list all possible entries)
Output: SolusLiveBudgie

then a simple cd SolusLiveBudgie to access the drive content and everything was just there.

Terminal output

Dolphin output
image

As you can see, both actually correspond.

This an example applicable to a precise kind of drive, i made as detailed an human understandable as possible for you but everyone too !

Blessings !

2 Likes

Thanks for the solution, I must admit you have a pretty good DE setup :slight_smile:

1 Like

Thank you so much, but after few days with it i’m now finding it less friendly i want it to be, so i need to come back work on it.

1 Like

Yeah its all barebones compared to other distros.

1 Like