Move a File to the Trash from the Terminal (Recoverable)
Delete with a safety net: Finder moves the file to the Trash instead of erasing it.
Run the osascript Finder delete one-liner with the full path to send the file to the Trash.
01Command
Command
$ osascript -e 'tell application "Finder" to delete POSIX file "/Users/you/Desktop/old-report.pdf"'02What it does
rm is permanent, but Finder's delete puts the file in the Trash where you can put it back — the right default when scripting cleanups. The path must be absolute, and defining a trash() helper in your shell profile makes it reusable in scripts. Empty the Trash later to actually reclaim space.
03Risk
!Warning: Files stay on disk until the Trash is emptied — deleting large files this way does not free space immediately.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Delete files and folders on MacEvidence: Apple documents that deleted files go to the Trash where they can be put back.
- osascript – Execute AppleScript and OSA scriptsEvidence: osascript -e runs an AppleScript one-liner; Finder's delete verb moves items to the Trash instead of erasing them.
Last verified: 2026-09-18 · Category: Files & Folders
06Related solutions
Find files larger than 500 MB on Mac
List the biggest files in your home folder that are eating disk space.
Show file extensions for all files on Mac
Make Finder display .pdf, .docx, .png and every other extension at all times.
Find Which Process Has a File or Volume Open with lsof
List every open file descriptor — files, directories, and network sockets — per process.