How to show .Trash and hidden files on USB sticks but not in $HOME?
Nautilus doesn't support automatically changing settings based on the directory. You can use Ctrl+H to manually toggle between showing or not showing hidden files (usually known as dotfiles), but Nautilus can't be configured to automatically toggle that option.
However, if you're using a filesystem on your flash drive that supports symlinks (not FAT32 or NTFS), you could work around your issue this way:
cd /path/to/your/flash/drive
ln -s .Trash Trash
This way, you'll have a non-hidden directory where you can easily check the contents of your trash.
Related videos on Youtube
![Nicolas Raoul](https://i.stack.imgur.com/F5gLZ.png?s=256&g=1)
Nicolas Raoul
I am Nicolas Raoul, IT consultant in Tokyo. Feel free to copy/paste the source code from my StackExchange answers, I release it to the public domain.
Updated on September 18, 2022Comments
-
Nicolas Raoul almost 2 years
In my home directory, there is a lot of files beginning with a dot, and I like the fact that Nautilus hides them. But when Nautilus hides
.Trash
on a USB disk, I risk leaking confidential documents inadvertently, wrongly thinking that I deleted all files from the USB stick I give to an acquaintance.So, how to set Nautilus to:
- Hide these files in my home
- But show them for USB sticks?
Another solution could be to disable Trash for USB sticks, but the idea is not implemented yet.
Any alternative solution welcome. I am looking for a permanent solution, so hitting CTRL+H each time is not a solution. -
Nicolas Raoul about 13 yearsUnfortunately the link trick is not usable, because the majority of USB sticks tends to be configured as FAT32 (especially those people lend to each other).
-
Scott Severance about 13 yearsYou're unfortunately correct. My flash drives must be usable on Windows machines. Grr.
-
Scott Severance about 13 yearsActually, I've heard that NTFS has something like symlinks. I haven't researched it, but perhaps you could reformat your flash drive as NTFS and use that trick. These days, NTFS is supported across all platforms.