sindresorhus/macos-trash

Move files and folders to the trash

Swift

459

40 commits

updated Aug 12, 2026

See the code

README

macos-trash

Move files and folders to the trash

Requires macOS 13 or later.

Since macOS 15, there is now a built-in trash command. The benefit of the binary here is that it has a --interactive flag and it fixes “Put Back” being broken.

Install

Homebrew
brew install macos-trash
Mint
mint install sindresorhus/macos-trash
Manually

Download the binary and put it in /usr/local/bin.

Usage

trash [--help | -h] [--version | -v] [--interactive | -i] [--empty] <path> […]

Tips

Use it as an rm alias

In your .bashrc or similar:

alias rm='trash'

Works as a drop-in replacement. All rm flags are ignored.

Build

./build
macos
swift-package
trash

Contributors

sindresorhus

33 commits

heilerich

1 commits

kaichaosun

1 commits

lgarron

1 commits

sindresorhus/macos-trash

Move files and folders to the trash

Swift

459

40 commits

updated Aug 12, 2026

See the code

README

macos-trash

Move files and folders to the trash

Requires macOS 13 or later.

Since macOS 15, there is now a built-in trash command. The benefit of the binary here is that it has a --interactive flag and it fixes “Put Back” being broken.

Install

Homebrew
brew install macos-trash
Mint
mint install sindresorhus/macos-trash
Manually

Download the binary and put it in /usr/local/bin.

Usage

trash [--help | -h] [--version | -v] [--interactive | -i] [--empty] <path> […]

Tips

Use it as an rm alias

In your .bashrc or similar:

alias rm='trash'

Works as a drop-in replacement. All rm flags are ignored.

Build

./build
macos
swift-package
trash

Contributors

sindresorhus

33 commits

heilerich

1 commits

kaichaosun

1 commits

lgarron

1 commits

Languages

Swift

98.6%

Shell

1.4%