trash: command not found

Trash is a free and open-source command-line interface (CLI) tool for managing the trashcan or recycling bin on Linux systems. It provides a simple and convenient way to delete files and directories while preserving the ability to recover them if necessary.

Trash allows users to delete files and directories from the command line and move them to the trashcan or recycling bin. This provides an alternative to permanently deleting files, which can be risky if important data is accidentally deleted. The tool also provides a way to recover files from the trashcan or recycling bin if they are needed later.

Trash supports a wide range of command-line options, including the ability to display the contents of the trashcan, restore files from the trashcan, and empty the trashcan. Additionally, the tool can be customized to suit the user’s needs, including setting the maximum size of the trashcan and specifying how long deleted files should be retained.

Trash is easy to install and use, and requires no special dependencies or libraries. It is compatible with most Unix-like operating systems, including Linux, macOS, and FreeBSD.

If you encounter the below error while running the command trash:

trash: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install trash-cli
Ubuntu apt-get install trash-cli
Arch Linux pacman -S trash-cli
Kali Linux apt-get install trash-cli
Fedora dnf install trash-cli
OS X brew install trash
Raspbian apt-get install trash-cli

trash Command Examples

1. Delete a file and send it to the trash:

# trash path/to/file

2. List all files in the trash:

# trash-list

3. Interactively restore a file from the trash:

# trash-restore

4. Empty the trash:

# trash-empty

5. Permanently delete all files in the trash which are older than 10 days:

# trash-empty 10

6. Remove all files in the trash, which match a specific blob pattern:

# trash-rm "*.o"

7. Remove all files with a specific original location:

# trash-rm /path/to/file_or_directory

Summary

Overall, Trash is a useful tool for managing the trashcan or recycling bin on Linux systems. Its command-line interface makes it easy to delete and recover files from the command line, providing a convenient and safe way to manage files and directories.

Related Post