When you make use of the rm (remove) command on the Mac Terminal, the files and folders are permanently deleted, you will not be finding them in the Trash. This can be really risky if you remove a folder or a file that is important by mistake because you may not be able to recover them.
In such cases, it is better to make use of the mv command instead of rm to move files and folders to the Trash folder. You can find the trash folder under your home directory. It is a hidden folder with the name .Trash.
Let's see some examples of moving files and folders to Trash using the Mac Terminal Command.
Move file to Trash using Terminal
% mv myfile.txt ~/.Trash/
Move a folder to Trash using Terminal
% mv myfolder ~/.Trash

-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to MacOS,
- Clear Screen shortcut macOS Terminal
- What is macOS Ventura?
- [fix] How to Show file extensions on all files on Mac
- How to Find Where Mac Terminal App is Located?
- AutoSave button not working on Office on Mac (Word, Excel or Powerpoint)
- macOS say command text to speech using various voices and languages
- How to change Ping TTL value on macOS
- Open .bash_profile File in TextEdit using Terminal
- How to know the Safari Version on Mac
- How to Copy full Absolute Path of a File on Mac
- 13.0 MacOS Ventura release date
- Enable spell check in Sublime Text (macOS)
- How to Display Analog Clock on Mac Menu Bar
- How to turn off Location Services macOS Ventura 13
- How to Open VS Code on Mac
- Add Bookmark macOS Safari
- How to Fix cd: too many arguments Error in Terminal: A Step-by-Step Guide
- How to install wget on macOS
- Select Line Number TextEdit on Mac
- Strikethrough Text in Excel for Mac
- How to Enable or Disable Dark Mode on macOS Ventura 13
- How to hide or display Wifi icon in macOS Bug Sur Menu Bar
- How to install Yarn on Mac (macOS)
- How to fix command not found brew (bash, zsh) on macOS Terminal
- How to Schedule Mails in macOS Ventura
More Posts:
- Java monitoring and management console [jconsole] - Java
- JSON column formatting to preview SharePoint Online file on mouse hover - SharePoint
- 3 Examples to read a text file line by line using java - Java
- MySQL: Error Code: 1175 You are using safe update mode - MySQL
- [Solved] com.sun.xml.ws.transport.http.servlet.WSServletContextListener ClassNotFoundException - Java
- How to hide or cancel Toast message in Android Programming - Android
- [Android] Sharing Multiple Images to Twitter App from your App - Twitter
- How to Stop Mac from Sleeping (macOS Ventura and Above) - MacOS