In this guide, we'll show you how to delete a file in Terminal on a Mac. Instructions apply to devices running macOS and OS X Lion (10.7) and later.
Whether you’re dealing with a troublesome file that refuses to leave your Mac or you want to quickly delete multiple files, Terminal makes it fast and easy. Here’s how:
Navigate to Terminal on your Mac by opening a Finder window and selecting Applications > Utilities.
In the Terminal window, type rm and a space.