Highlights:
How to Use macOS Terminal and Why It’s Still Useful
18/9/24
By:
Bharti B. Hariyani
Exploring the Power of Command Line Interfaces on macOS
Despite the evolution of modern computing, the command line interface (CLI) is still a powerful and useful tool in today’s operating systems. On macOS, the Terminal app provides access to this world, offering a wide range of commands that can boost productivity, customize settings, and even troubleshoot issues. Whether you're a tech enthusiast or just someone looking to get more out of your Mac, the Terminal offers plenty of handy features.
Here’s how you can access and make use of macOS Terminal, along with some of the most useful commands.
How to Access macOS Terminal
There are two main ways to open Terminal on your Mac:
Via Spotlight Search: Press Command + Space to open Spotlight, type "Terminal," and press Enter.
Via Finder: Navigate to Applications > Utilities and click on Terminal.
Once you have Terminal open, you're ready to explore the power of macOS through commands.
9 Useful macOS Terminal Commands
1. Change How Screenshots are Saved
defaults write com.apple.screencapture name “New Screen Shot Name”
By default, screenshots are saved with names like "Screen Shot [date] at [time].png." With this command, you can change the prefix to a custom name. It’s perfect for organizing screenshots when you’re working on projects that require multiple images.
2. Keep Your Mac Awake
caffeinate -t <seconds>
This command keeps your Mac awake for the specified time in seconds (e.g., 300 for 5 minutes). It’s a quicker alternative to adjusting power settings manually, especially useful for long downloads or processes that shouldn’t be interrupted.
3. Get Real-Time System Status Readings
top
The top command is a handy way to view real-time stats about your Mac’s performance, including CPU and memory usage by each application. It's a quick alternative to using the Activity Monitor.
4. Force Quit Apps
killall AppName
If an app becomes unresponsive, you can force quit it through Terminal by replacing "AppName" with the app's name (e.g., killall Finder). It’s an efficient troubleshooting tool if your system freezes.
5. Add a Message to the Login Screen
sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText “Your Message Here”
This command lets you add a custom message to the macOS login screen. It could be something inspirational, or practical — like your contact information in case your Mac gets lost.
6. Shut Down or Restart Your Mac
sudo shutdown -h now
For shutdowns, and:
sudo shutdown -r now
For restarts. You can also schedule a shutdown or restart, e.g., sudo shutdown -r +10 will restart your Mac in 10 minutes. This is perfect if you want your Mac to automatically restart after completing a task.
7. Show a Simple Calendar
If you need to quickly check a specific date or month, the cal command shows you the current month’s calendar. You can even get specific dates, such as cal 1980 for the year 1980 or cal 1 2030 for January 2030.
8. Software Update
The softwareupdate command checks for available updates for your macOS system. You can install updates with:
This is a great alternative to manually checking for updates through System Settings.
9. Add Spaces to Your Dock
defaults write com.apple.dock persistent-apps -array-add ‘{“tile-type”=”spacer-tile”;}’; killall Dock
If you like to organize your apps in the Dock, this command adds blank tiles to create visual separations between icons. You can drag these spaces around or remove them by right-clicking the space and choosing "Remove from Dock."
Why Use Terminal?
The Terminal in macOS is a powerful tool that offers customization options you won’t find in system preferences. It gives you more control over your Mac, and for many users, learning a few essential commands can save time and add new functionalities to their workflows.
Whether you’re changing how screenshots are saved, adding separators in your Dock, or updating software, Terminal can streamline tasks and offer functionality beyond the GUI (Graphical User Interface).
So, fire up Terminal and start exploring — your Mac is capable of more than you think!
All images used in the articles published by Kushal Bharat Tech News are the property of Verge. We use these images under proper authorization and with full respect to the original copyright holders. Unauthorized use or reproduction of these images is strictly prohibited. For any inquiries or permissions related to the images, please contact Verge directly.
Latest News