How to see which drive a file is on

trying to manage files and backups
When I look at the file locations, the drive seems to be missing from the location shown.

How do we see where the file location is? (Without missing parts of the location, especially the base of it)

There is no such thing as a drive.

You have a location where the partition has been mounted - if it is automounted the location is


Example is one of my usb


If I list the content

 $ ls /run/media/fh/WDUSB-ISO/

The location is a tree with branches and leaves - actually - the package tree contains a command to visualize the content of the system tree

This is just one level

 $ tree / -L 1
├── a
├── bin -> usr/bin
├── boot
├── dev
├── etc
├── home
├── lib -> usr/lib
├── lib64 -> usr/lib
├── lost+found
├── mnt
├── opt
├── proc
├── root
├── run
├── sbin -> usr/bin
├── srv
├── sys
├── tmp
├── usr
└── var

Let’s take a branch

 $ tree /usr -L 1
├── bin
├── include
├── lib
├── lib32
├── lib64 -> lib
├── local
├── sbin -> bin
├── share
└── src

Or a home folder - not a common layout - I admit that

 $ tree /home -L 2
└── fh
    ├── Desktop
    ├── Documents -> /a/private/.home/Documents
    ├── Downloads -> /a/private/.home/Downloads
    ├── Music -> /a/private/.home/Music
    ├── Pictures -> /a/private/.home/Pictures
    ├── Postman -> /a/private/.home/Postman
    ├── Public -> /a/private/.home/Public
    ├── Templates -> /a/private/.home/Templates
    ├── Videos -> /a/private/.home/Videos
    └── VirtualBox VMs -> /a/virtualbox
  • / - where everything starts
  • /home/user - is a user’s home folder
  • /run/media - is a volatile structure which only exist at runtime
  • /run/media/user/some-uuid-or-name - is a partition mounted automagically by the system

Mounts can also be defined to be static - in which case the file /etc/fstab or a mount unit is used for defining What, Where and How a partition is mounted.


Hi @Try042bcbbf9b130bef,

As @linux-aarhus said, in/with Linux there is no such things ass drives. You’ll have to know which partition is mounted where, and from that you can deduce on which partition and then drive it is. See below for more:

1 Like


command df or lsblk is useful for you ?

where ? dolphin , terminal command, application ?


Dolphin, and file properties in dolphin
(Why is there a ~ in the dolphin listing, but not in the properties listing?)

The tilde is a shortname for the logged in user’s home It only works for the currently logged in user e.g. the following is a reference to the same file

  • /home/$USER/.bashrc
  • ~/.bashrc

the dot (.) is signaling a hidden file - that is - it will not be shown unless you tell Dolphin to show them - use Ctrlh to toggle.


cat /home/$USER/.bashrc


cat ~/.bashrc
1 Like

where is my ~ (home) ?

echo $HOME

same results for:

ls -ld $HOME
ls -ld ~
ls -ld /home/$USER
1 Like

Thats interesting to know, but I am very puzzled by why they dont match.
Its the exact same file, it would make sense that it would be showing the exact same location.

Is this schroedingers file?

~ is shorthand, a shortcut, ehateverryoucall it to $HOME, which is, in turn, a shortvut/shorthand/variable/whateverit’scalled to `/home/<username``, your home, personal, directory…


My mistake. Both point to your home directory:

$ echo ~                                                                                                                                                                                                                                             

$ echo $HOME

Ok so , if I have some files on save SDA2
and I want to copy them to NVME

How would that be done?

I look at my root properties, an it says its nvme, and my files I want to copy are on root in SDA2 (I think) , how can someone move them from SDA2 to NVME?

Alternatively, how could I overwrite the faulty OS files on SDA2 with the working OS files in NVME, and boot my system files normally?

Thats really a different question than posed here … though you could employ some of the things mentioned, like df and ls to look at things.

As others said, use df to get under which mount point the folder is, e.g.

df -h --all /home/$USER
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2  500G  100G  400G  20% /

For your partition (e.g. sda2) find if it’s mounted

mount | grep -i "sda2"
/dev/sda2 on /mnt/smth

If not you’ll need to mount it using sudo mount