• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

trash: command not found

by Deepika

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.

Filed Under: Linux

Some more articles you might also be interested in …

  1. groupmod Command Examples in Linux
  2. jstack Command Examples
  3. How to monitor your CPU on debian or ubuntu systems
  4. certutil: Manage keys and certificates in both NSS databases and other NSS tokens
  5. fold: Wraps each line in an input file to fit a specified width and prints it to the standard output
  6. “git verify-tag” Command Examples
  7. getsebool: command not found
  8. luac Command Examples
  9. How to Install wine64-preloader software package in Ubuntu
  10. powerstat Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright