I remember the nice mv somefile ~/.Trash
command but that folder does not exist on newer Ubuntus. Does anyone know why?
Ubuntu – Why is there no more ~/.Trash
xdg
xdg
I remember the nice mv somefile ~/.Trash
command but that folder does not exist on newer Ubuntus. Does anyone know why?
Best Answer
According to the freedesktop.org Trash Specification:
If the environment variable
$XDG_DATA_HOME
is either not set or empty,~/.local/share
is used. So by default, the trash folder is~/.local/share/Trash
.Regardless, the easiest and best way to trash a file from the command line is to use the trash command.
Use it like you would use
rm
:This is better than just
mv
'ing a file into~/.local/share/Trash
because it stores metadata such as where the file was originally so you can restore (un-delete) it if need be.