1. Check the command and the file before moving it
Apple’s installed trash manual says the command first appeared in macOS 15.0. Check /usr/bin/trash directly so a shell alias or a separately installed tool cannot silently change which program these examples use. If the check prints “Use Finder instead”, skip to the Finder fallback below.
The examples assume Old report.pdf is in your current folder. Run pwd and ls first, then replace the example with the exact item you have reviewed. The ./ prefix makes a relative filename unambiguous even when its name starts with a hyphen; double quotes keep spaces in one argument. A folder includes everything inside it, so open it before choosing to remove it.
if [ -x /usr/bin/trash ]; then
printf "Built-in trash is available\n"
else
printf "Use Finder instead\n"
fi
pwd
ls -ld "./Old report.pdf"2. Move the selected item and check the result
Run the following only after checking the item above. -v prints details; -s stops on a failed move and returns an error. Check the status immediately, before running another command. A nonzero result means you need to read the error, not retry with sudo or switch to rm.
A batch is not a transaction. Earlier items may already have moved before a later one fails; -s does not roll them back. Open the Trash in Finder and compare it with the source folder before retrying any remaining items. Moving to Trash usually leaves the data on the same volume, so this is not a promise that free disk space will increase.
/usr/bin/trash -v -s "./Old report.pdf"
printf "Exit status: %s\n" "$?"- Expected success: the source item disappears and is visible in Finder’s Trash. Review its name and contents there before emptying anything.
- Missing path: correct the spelling or current folder. In our macOS 27.0.1 fixture check, a missing first path returned status 5 and -s left the second test file untouched. That is an observed example, not a portable list of exit codes.
- Permission or privacy error: use Finder to inspect the item and the permissions you already have. Do not disable security or broaden disk access just to list the Trash.
- Partial batch: keep the error output and review both locations. Never treat the whole batch as unchanged after a failure.
3. Keep a way to recover the item
Click the Trash in the Dock. If Finder offers File → Put Back, use it; otherwise drag the item to a folder you choose. Do not assume that every command-line trash tool preserves the same restoration metadata. We tested the missing-path failure above, not successful restoration or external-volume behavior.
Apple notes that Finder can automatically remove local items after 30 days if that setting is enabled. Items trashed from iCloud Drive are removed after 30 days regardless of that Finder setting. Emptying Trash removes the ordinary recovery path. Keep a separate backup for anything important, and do not empty the Trash as part of testing these instructions.
For a file in an iCloud-synced folder, deletion can propagate to other devices. If your goal is to keep the cloud file and remove only its local download, use Finder’s iCloud Remove Download action where available instead of trashing it.
On older macOS, reveal the item in Finder
If /usr/bin/trash is unavailable, reveal the exact item in Finder with open -R, review the selection, and choose File → Move to Trash or press Command-Delete. The command below only reveals the item; it does not delete it.
Finder automation through osascript is another possible approach, but it introduces Automation permission and path-escaping requirements. This fallback works without granting Terminal control of Finder. If Finder cannot trash the item, investigate its location and the specific error rather than bypassing the failure.
open -R "./Old report.pdf"If you already use a Homebrew trash tool
Homebrew’s trash formula is separate from /usr/bin/trash. Its formula page marks it keg-only because macOS provides similar software, so installing it does not necessarily make it the command your shell runs. Check the chosen tool’s own help and installation path before using it; do not assume Apple’s -s flag or exit behavior applies.
You do not need to install a package for this task on a Mac that already has /usr/bin/trash. On an older Mac, Finder is the simplest fallback if you do not already maintain command-line tools.
Keep rm and trash as separate commands
rm removes directory entries without moving items to Finder’s Trash. An alias can behave differently in scripts, other shells or another machine, and the two commands do not share all their flags. Use trash explicitly when you want Trash behavior. Do not replace a failed trash operation with rm -rf.
These instructions cover selecting and moving known items. They do not identify which caches, app data or system folders are safe to remove. The linked storage and permissions guides cover those decisions separately.
Common questions
How do I move a file to the Trash using Terminal on Mac?
On macOS 15 or later, first review the file path, then use /usr/bin/trash -v -s with that quoted path. Check the exit status immediately and confirm the item in Finder’s Trash. On older versions, reveal it with open -R and use Finder’s Move to Trash action.
Does -s undo a partly completed trash command?
No. It stops on a failed move, but earlier items can already be in the Trash. Check the source folder and Finder’s Trash before retrying the items that remain.
Is it safe to alias rm to trash on Mac?
Keep the commands separate. Their flags and behavior differ, and an alias does not protect scripts or other environments. Use trash by name when you want items moved to the Trash.
Why can’t I list ~/.Trash in Terminal on Mac?
macOS privacy controls can restrict Terminal access, but the error alone does not diagnose every failure. Open the Trash in Finder to check the result. You do not need to broaden Terminal’s permissions merely to confirm a trashed item.
References & further reading
These guides combine the linked official guidance with ClearDisk’s documented behavior. Your files and app settings determine the right next step.