In computing, a recycle bin, or trash, is temporary storage for files that have been deleted in a file manager by the user, but not yet permanently erased from the physical media. Typically, a recycle bin is presented as a special file directory to the user (whether or not it is actually a single directory depends on the implementation), allowing the user to browse deleted files, undelete those that were deleted by mistake, or delete them permanently (either one by one, or by the "Empty Trash" function).
Within a trash folder, a record is kept of each file and/or directory's original location. Files must be moved out of the trash before they can be accessed again.
Whether or not files deleted by a program go to the recycle bin depends on its level of integration with a particular desktop environment and its function. Low-level utilities usually bypass this layer entirely and delete files immediately. A program that includes file manager functionality may or may not send files to the recycle bin, or it may allow the user to choose between these options.
Apple Inc. sued to prevent other software companies from offering graphical user interfaces similar to its own. Apple lost most of its claims but courts agreed Apple's Trash icon was original and protected by copyright. Non-Apple software may use other metaphors for file deletion, such as Recycle Bin, Smart Eraser, or Shredder.
In early versions of the Macintosh Finder, Trash contents were listed in volatile memory. Files moved to the Trash would appear there only until the Finder session ended, then they would be automatically erased. When System 7 was released, the Trash became a folder that retained its contents until the user chose to empty the trash.
Recycle Bin first appeared in Windows 95. In this version, the original location record of the file is stored, but the folder itself didn't allow subdirectories. When a folder is deleted, its containing files are moved into the bin and mixed with other deleted files. The directory structure can only be restored if the batch of files are "undeleted". A revised Recycle Bin allows for subdirectory trees within the recycle bin.
The KDE, GNOME and Xfce implementations comply with the freedesktop.org Trash specification , ensuring that any applications written with this specification in mind will be interoperable with any trash can implementation.
Under Mac OS X, when a file is deleted in Finder, it is copied to a folder named .Trashes/ username / within the original directory, and when viewing the device's available space the space occupied by the deleted files is shown as occupied.
Some implementations may contain "shredding" functionality to counter data remanence.
Mac OS has long allowed dragging a disk icon to the Trash as a method for ejecting a disk, but this does not place the disk in the Trash folder nor does it erase the disk. In Mac OS X the Trash icon temporarily changes to an Eject or Disconnect symbol whenever storage volumes are dragged.
The GNOME Human Interface Guidelines cite such behavior as an example of a discouraged metaphor.