Using the terminal, how can I see the directory (and files) in an external HDD attached via USB port? (I am a beginner so would appreciate simple instructions. I have tried to find the answer through "search" – there are similar questions with answers that I tried to bend to my needs but could not – sorry).
Ubuntu – Using the terminal, how can I see the directory (and files) in an external HDD attached via USB port
directoryhard drive
Best Answer
The topic that you're looking for is mounting . In the file manager you just click on the button to open it or detach the drive, but behind the scenes it uses
udisksctl
. Big advantage of this command is that it mounts as your user, and you don't have to specify whole lot of options, unlike the classicmount
command.For instance, to mount your usb drive, find device path with either
lsblk
orsudo blkid
and then mount like so, for example,Of course remember to replace
sdb1
with the actual device name you want to mount.Once the device is mounted successfully, it will be reported where it is mounted. For example,
Then you could navigate to
/media/$USER/folder-name
and start exploring files and folders