For these jobs and others, the Mac Terminal is your new best friend.
What Is the Terminal?
The Terminal is a utility that allows you to interact with your Mac through the command line.
Linux operating systems include similar tools, since both Linux and macOS are Unix-like OSes.
The basic commands were using here should work with either, however.
There are various ways toopen the Terminal on your Mac.
Phil King/MakeUseOf
There are many more things you’re free to do in the Terminal, too.
When zsh sees a space, it interprets it as the end of a command.
What’s going on here?
Phil King/MakeUseOf
Well, zsh thinks that you calledlsonDocuments/Path.
When it couldn’t find a file or directory with that name, it stopped.
Sudo
Many of the commands below require administrator-level access.
Phil King/MakeUseOf
The syntax offindconsists of four parts.
In order, they are:
You should know thatfinduses regex (also called regular expressions).
Here were using the asterisk (*), which acts as a wildcard character.
Phil King/MakeUseOf
du
Replaces:Cmd + Ito show info.
The best options forduare:
mv
Replaces:Point-and-click moving of folders and files.
Why it’s better:It’s faster and requires no navigation.
you’ve got the option to quickly move a file or folder into another folder usingmv.
It works by simply changing the name of the path.
The syntax is:
For example:
…will movefile1.rtffrom thejdoeusersDocumentsfolder to theDesktop.
Create new folders in an instant with this command.
For example, the command:
…creates a newcool_stufffolder inDesktop.
rm
Replaces:Moving files to the Trash and emptying it.
This command will delete, immediately and without prejudice, any file you put in its path.
Obviously, use it with extreme caution.
Unlike clickingEmpty Trash,rmwill not ask if you’re sure.
It assumes you know what you’re doing.
One thing to note aboutrmis that by default, it will only delete files, not folders.
To delete folders, you must use the-Roption, which stands for “recursive”.
…will delete thecool_stufffolder inDesktop.