The latest edition of DMN Security Bite is brought to you by Mosyle, the premier Apple Unified Platform. Our sole mission is to ensure that Apple devices are ready for work and secure for enterprise use. With our distinctive management and security approach, we integrate advanced Apple-specific security solutions for automated Hardening & Compliance, Next-Gen EDR, AI-driven Zero Trust, and exclusive Privilege Management layered upon the most robust and modern Apple MDM available. This means a fully automated Apple Unified Platform trusted by over 45,000 organizations to make millions of Apple devices ready for use effortlessly and affordably.Claim your EXTENDED TRIAL today and discover why Mosyle is your go-to for Apple solutions.
Recently, I have delved into some lesser-known features of Terminal. Over the last few months, I have discussed everything from enabling Touch ID for sudo authentication to managing public Wi-Fi connections saved on your Mac. Last week, I went even further and uncovered a variety of capabilities you likely didn’t realize Terminal could perform, and I assure you, it goes beyond the basic ping command. In this Security Bite edition, let’s take your command line skills a notch higher.
You may be asking, “What does this have to do with security?” A valid question—since this is indeed a DMN Apple security piece. While not every command listed below is explicitly focused on security, they can enhance your productivity and demonstrate useful techniques.
Gaining proficiency in Terminal boosts your understanding of how the system operates.
Keep Your Mac Awake
Even your Mac deserves a coffee break! If you’re downloading or processing a large file and need your machine to remain awake while you step away, simply run caffeinate
in Terminal to accomplish this effortlessly.
Your Mac will stay awake indefinitely, which allows you to step away without fearing interruptions in your process. Upon return, simply press Ctrl+C to exit and return to normal behavior.
You can also specify a duration for caffeinating your Mac by entering caffeinate -t
, where specifies the amount of seconds.
For instance, if you want your Mac to stay awake for one hour, replace with
3600
.
Customize Screenshot File Names
For those who frequently use the Screenshot utility on their Mac, you may find that the default naming convention starts each file with “Screenshot,” which can be confusing when juggling multiple applications. Instead of cluttering your desktop with numerous “Screenshot” files, you can rename them based on the task at hand with the following command:
defaults write com.apple.screencapture name
Substitute
with your preference for easier identification of screenshot files. For example, I chose “Security Bite” as my identifier. From now on, all screenshots captured will begin with this name until I change it back to the original default or another option entirely.
Moreover, we can edit the file formats as well. By default, screenshots are saved as PNG files, which are excellent for quality yet may occupy excessive space.
Formats you can use include PNG, JPG, PDF, GIF, and TIFF.
If you wish to save a screenshot in PDF format, simply use:
defaults write com.apple.screencapture name SecurityBite type pdf
Flush Your DNS Cache
When you visit a website, macOS keeps a record of its IP address in a local DNS cache. This database speeds up domain name resolution for Safari and other browsers, eliminating full DNS lookups on subsequent visits.
However, over time, this cache can become outdated or overcrowded, occasionally leading to slower page loading or notifications like “DNS Server Not Responding.” Although macOS automatically clears the DNS cache periodically, you can manually refresh it when encountering connectivity issues or after modifying DNS settings.
To flush the DNS cache manually, run the following commands sequentially:
sudo killall -HUP mDNSResponder
(password needed)sudo killall mDNSResponderHelper
sudo dscacheutil -flushcache
Convert Text to Speech with Terminal
This feature is simply entertaining! In Terminal, type say "hello world"
, and hit return. Your Mac will vocalize it for you. If you prefer a different voice, you can change it by adding -v
followed by the preferred voice’s name.
Type: say -v"?"
to view a complete list of available voices.
For instance, if you fancy Tina’s voice, you would then type: say "Feel free to type anything here" -v Tina
Additionally, you have the option to save the generated speech to a file using: say "Type anything you want to say here" -v Tina -o
You can save in formats such as aiff, caf, m4a, and wave.
The output will be stored in Macintosh HD .
I’m labeling this article as “Part 1,” as I anticipate more tips to share soon. If you found any of these commands useful, feel free to leave a comment. Are there any other tips I should consider adding?
Follow Arin: Twitter/X, LinkedIn, Threads