The 44 most useful Mac Terminal commands!
Using the Windows terminal (popularly known as the Command Prompt) and Linux is a common task for users of these systems, not least because the available commands are very useful on several occasions. The Mac and Macbook also have a command terminal, but most users of Apple computers have a certain fear and tend to be afraid of doing something wrong with the software. It turns out that the Mac’s Terminal is there to make using the device easier and can be used to your advantage in any situation.
To use it, just search for “Terminal” in Spotlight search. Pretty simple, isn’t it?! If you want to make good use of this tool, you can even check out some of the most useful commands below!
This command lists the name of the files in the directory currently being used.
2. cd “directory name”
Use this command to go to another directory. Just type in the directory’s name without the quotation marks by the side of the command and hit Enter.
3. cd ..
This command helps you go one directory up from the one you’re using right now. AKA, the previous directory.
When typing this in without anything at the side in the Mac Terminal, you’ll be taken to the currently used directory.
This command shows the currently used directory path on the Terminal.
6. mkdir “directory name”
To make a new directory, use this command and type in its name right at the side (without quotation marks).
7. rmdir “directory name”
Use this command to delete an empty directory. Just type in its name (without quotation marks) right at the side of the command before hitting Enter.
This very simple command helps you in copying one or more files quickly. Just type in its name at the side of the command before hitting Enter.
If you want to change the access permissions of one of your files, just use this command.
This Mac Terminal command will compare the differences between two previously selected files.
11. more “file name”
This command displays a text file one page at a time. In this case, you have to press the space key to see the next page or the Q key to exit the display screen.
12. mv “file name”
This command helps you to rename a file easily. You can also use it to move the file around to other locations.
14. rm “file name”
This command is very simple and only serves to delete the file you name.
This command simply terminates most of the operations being performed.
Enter this command in the Mac Terminal to have the current date and time displayed directly in the Terminal.
The “echo” command is for anything after it to be repeated one more time.
When typing “help” in the Terminal, a small list of useful commands will appear on the screen.
The “history” command can be very useful, as it displays the last commands that were typed in the Terminal.
This command opens a simple text editor if you ever need one.
This simple command serves to display all processes and operations that are currently active.
This command is to allow you to perform certain tasks for which your account does not have permission. You will still need to enter the administrator password.
23. defaults write com.apple.finder AppleShowAllFiles TRUE
This slightly longer command is for all hidden files on your Mac to be displayed normally. To disable this, just change TRUE to FALSE at the end of the command.
24. defaults write com.apple.screencapture type file-extension
In general, Mac screenshots are saved in PNG format, but you can change that with the above command in the Mac Terminal. Just change the “file-extension” to the extension of the type of file you want the photos to be saved. Just put the three-letter extension, like JPG or PDF, depending on what you want to use.
25. say Hello World!
This command is more funny than useful, as it only serves to make the Mac say a few words.
26. defaults write com.apple.dashboard devmode YES
This command is for placing your Mac’s dashboard widgets directly on your computer’s desktop. To reverse this, just replace YES with a NO at the end of the command.
This command can be extremely useful as it displays your Mac’s used and free memory.
This Mac Terminal command is to prevent the Mac from going into hibernation or sleep mode when not being used for some time.
This simple command shows the Mac calendar automatically.
With this command, you can schedule another command to be activated specifically at another time or day.
This command simply serves to clear the Terminal screen. Quite handy if you’ve been using the software for some time.
Use this command to quickly display and use a calculator.
This command basically serves to transfer information from one server to another.
Use this command to split a file into several parts.
Use this command to display the free hard disk storage on the Mac Terminal screen.
This command can be used to copy selected files and folders.
This command is used to allow root access to the computer. Use it with caution.
This command displays the last user to log in to the Mac in question.
39. locate “file name”
This command can be used to find miscellaneous files on the computer. Just put the file name next to the command.
Use this command to print a previously selected file.
You can use this command in the Mac Terminal to quickly open the Spotlight search and do a search there.
This command is simply for opening a file, folder, URL, or application on your Mac. Just specify the name of whatever you want to open next to the command before hitting Enter.
This command can be used to change the password for one of the Mac users in question.
Use this command to do a quick check of your internet connection. It can be very useful if you notice a slowdown on the network.
Did you like these tips about the Mac Terminal?
So, was our list useful for you? If so, share this article with other Mac users in your midst to help them out!