1

I have few files in a USB disk named F:. I The files inside it are large. I do not want to move them to my harddisk. I want to make some comparison, e.g. diff between files from inside the USB and in the disk.

The problem is I am unable to know the USB disk path or how to access it? It seems under the root directory. But when I type cd F to go inside the F I get error:

bash: cd: F:: No such file or directory

EDIT: I use Ubuntu 18.04 Desktop

1
  • 3
    Naming drives with letters (C, D, F) is a Windows thing. Please edit your question with details of what Unix or Linux operating system you're using. To view the contents of the USB drive you will need to mount the device, which many OSes will automatically do for you. – Kevin Kruse Aug 22 '18 at 18:13
2

As has already been said in the comment, your disk isn't "named F:". F is just the drive letter that gets assigned to it under Windows.

A bit of background: The USB disk will show up as an USB device (see a list of them with lsusb) when connected; the USB storage interface of your disk will show up as a SCSI device (see a list of them with lsscsi), the OS will create a block device for it (/dev/sdX, where X is the next free letter) and block devices for all partitions (/dev/sdXN, where N is a number), and you will get symlinks to these devices using various bits of other information under /dev/disk/by-*. An equivalent thing happens under Windows (but the user doesn't notice).

I'll assume that your Ubuntu has some working kind of automounter, and in that case the it will assign some file path to it under which you can access the contents of your disk. You can see all mounted devices with mount, look for your disk among them (or look at the difference between the outputs with and without the USB drive connected).

I'm not very familiar with Ubuntu Desktop, but probably it will appear under /media/some_other_name. If it doesn't, you explicitly need to mount it. In that case, you'll have to choose a directory.

Once you know the path where it is mounted, you can cd into it as usual.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.