Home > Article > Operation and Maintenance > Does linux have a recycle bin?
Linux does not have a recycle bin. When a file is deleted, the file will be permanently deleted and cannot be recovered. You can use tools to simulate the recycle bin: 1. trash-cli, a command line tool. When using this tool to delete files, The file will be moved to a specified recycle bin directory; 2. gvfs-trash, a command line tool. When using this tool to delete a file, the file will be moved to the "~/.local/share/Trash/" directory; 3. The Recycle Bin function of the file manager, when a file is deleted, the file will be moved to the Recycle Bin directory.
The operating system of this tutorial: Linux5.18.14 system, Dell G3 computer.
In Linux systems, there is no recycle bin by default. When you delete a file, it is permanently deleted and cannot be recovered. This is different from the Recycle Bin in Windows systems.
But you can use some tools to simulate the function of the recycle bin to delete files more safely:
1. trash-cli: This is a command line tool that can simulate recycling site functions. You can install it using the following command:
sudo apt-get install trash-cli
When you use this tool to delete files, the files will be moved to a specified recycle bin directory (the default is ~/.local/share/Trash/), You can restore or permanently delete files through the command line or file manager.
2. gvfs-trash: This is a command line tool that can also be used to simulate the function of the recycle bin. It can be installed using the following command:
sudo apt-get install gvfs-bin
When you delete a file using this tool, the file will be moved to the ~/.local/share/Trash/ directory. You can restore or permanently delete files through the command line or file manager.
3. The recycle bin function of the file manager: Some file managers (such as Nautilus, Caja, Dolphin, etc.) provide the recycle bin function. When you delete a file, it will be moved to the Recycle Bin directory, and you can restore or permanently delete the file through the file manager. Typically, the Trash directory is located at ~/.local/share/Trash/.
Please note that the above tools and methods may vary depending on your Linux distribution and desktop environment. You can choose the appropriate tool or method based on your system and needs.
The above is the detailed content of Does linux have a recycle bin?. For more information, please follow other related articles on the PHP Chinese website!