Empty trash linux6/11/2023 ![]() You can also use wildcards to delete multiple files at once. The basic syntax is as follows − $ trash-rm įor example, to permanently delete a file named "example.txt" from the trash, the command would be − $ trash-rm example.txt This command will remove a file from the trash without moving it to a recycle bin. If you want to permanently delete a file from the trash and skip the recovery process, you can use the " trash-rm" command. You can then use the trash-put, trash-list, trash-empty, trash-restore commands as usual. You can set the XDG_DATA_HOME and XDG_CONFIG_HOME environment variables to specify a custom location for the trash.įor example, to set the trash location to /mnt/trash $ export XDG_DATA_HOME=/mnt/trash home/user/example2.txt Mon Jan 28 14:00:00 2022ę192īy default, the trash is located at “ $HOME/.local/share/Trash”, but you can customize the location of the trash. The basic syntax is as follows − $ trash-listįor example, the output of the command − /home/user/example.txt Wed Jan 27 14:21:11 2022ĕ97 This command will display the files and directories in the trash, along with their original path, date deleted, and size. To list the contents of the trash, you can use the " trash-list" command. This command will empty all files and directories older than three days from the trash bin. ![]() For example, to empty all files that have been in the trash bin for more than 3 days, use the following command − $ trash-empty 3 You can also specify a number of days to empty the trash bin. It is important to note that emptying the trash bin permanently deletes all of the files and directories stored in it, and they cannot be restored. The basic syntax is as follows − $ trash-empty This command will permanently delete all files in the trash, so use it with caution. To empty the trash, you can use the " trash-empty" command. For example, to restore all files with the ".txt" extension, the command would be − $ trash-restore *.txt You can also use wildcards to restore multiple files at once. The basic syntax is as follows − $ trash-restore įor example, to restore a file named "example.txt", the command would be − $ trash-restore example.txt To recover a soft-deleted file, you can use the " trash-restore" command. For example, to delete all files with the ".txt" extension, the command would be − $ trash-put *.txt ![]() The basic syntax is as follows − $ trash-put įor example, to soft-delete a file named "example.txt", the command would be − $ trash-put example.txt The " trash-put" command is used to move a file to the trash or trash. Commands for temporary or soft deletion of files We will also discuss how to recover deleted files, list files in trash and empty the trash. In this article, we will explore how to delete files from the terminal on Linux using the " trash-put" command. That way, if you accidentally delete a file, you can easily get it back. A soft delete allows you to move a file to a designated recycle bin or trash, instead of permanently deleting it. This is where the concept of " soft delete" comes into play. When working with files in the terminal on Linux, there may be times when you want to delete a file but also keep a copy of it just in case. ![]()
0 Comments
Leave a Reply. |