
9to5Mac Safety Chew is solely delivered to you by Mosyle, the one Apple Unified Platform. Making Apple gadgets work-ready and enterprise-safe is all we do. Our distinctive built-in strategy to administration and safety combines state-of-the-art Apple-specific safety options for absolutely automated Hardening & Compliance, Subsequent Era EDR, AI-powered Zero Belief, and unique Privilege Administration with essentially the most highly effective and trendy Apple MDM available on the market. The result’s a completely automated Apple Unified Platform presently trusted by over 45,000 organizations to make thousands and thousands of Apple gadgets work-ready with no effort and at an inexpensive value. Request your EXTENDED TRIAL in the present day and perceive why Mosyle is every part you must work with Apple.
I’ve not too long ago fallen into the rabbit gap of lesser-known Terminal options. These previous months, I lined every part from enabling Contact ID for sudo authentication to cleansing up public Wi-Fi connections saved in your Mac. However this week, I need to share much more neat options you in all probability didn’t know Terminal might do. These will be useful in case you’re an on a regular basis Mac consumer or managing an enterprise fleet. On this version of Safety Chew, permit me to raise your command line prowess additional.
Extra: Down the rabbit gap of neat, lesser-known Terminal instructions (Pt. 1)
Whereas not all instructions beneath are explicitly security-focused, they might assist you work smarter, enhance your effectivity, and will let you showcase some genuinely helpful methods. Being proficient in Terminal helps you suppose just like the system, and considering just like the system is step one in securing it.
Password-protect a compressed folder

A .dmg (disk picture) file is sort of a thumb drive in software program type. It’s utilized in macOS to bundle and distribute purposes, information, and infrequently even malware. Nevertheless, it can be used to retailer and ship confidential or delicate info. Final week, I discovered from a buddy (Hey Charlie) that you may compress a folder right into a .dmg file with AES-128 encryption from inside Terminal. This is similar normal utilized by governments in the present day. Anybody receiving the .dmg file would want the password to decrypt and open it. Right here’s how:
First cd
to the listing containing a folder you wish to compress. I’m utilizing Desktop within the instance beneath for simplicity.
Now, sort:
hdiutil create -encryption -stdinpass -srcfolder ~/Desktop -volname "[Name of the folder as seen in directory]" -format UDZO ~/Desktop/[Name your compressed file].dmg
Admittedly, this can be finished from throughout the Disk Utility GUI. In case you’re having hassle doing it in Terminal, do that:
- Open Disk Utility utility
- Go to File –> New Picture
- Click on Picture from Folder
- Choose the folder you’d prefer to compress and defend
- Identify the .dmg file, choose its location, and encryption normal (AES 128 or 256)
Get pleasure from!
Facet notice: Please don’t use zip -er
to password-protect compressed folders. I’ve seen examples of this on-line. This makes use of the now-out-of-date ZipCrypto encryption normal, which will be decrypted in minutes utilizing any of quite a lot of free instruments. It’s not safe.
Rapidly verify and replace software program

Everyone knows easy methods to replace to the most recent macOS model manually in Settings, however we will use Terminal to do it faster and with slightly additional benefit.
Sort:
softwareupdate -l
This can listing all obtainable updates to your Mac (excludes App Retailer apps). You may obtain and set up a selected file by utilizing the next command:
softwareupdate -i "
[Title]
“
You can even obtain and set up all updates in a single swoop by utilizing:
softwareupdate -i -a
Press enter and also you’re golden!
Auto-check and replace extra usually

Apple already has computerized replace checks enabled by default, however the default verify frequency is as soon as each 7 days. We are able to use Terminal to order our Mac to verify for software program updates and notify us extra (or much less) often. For instance, right here’s easy methods to carry out checks day by day:
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
sudo softwareupdate --schedule on
The ending interval within the first command is the variety of days between checks. For instance, in case you change to three, it’s going to verify for updates each 3 days. The second command is mainly us telling our machine “Hey, please really comply with the schedule I gave you.”
In case you’re not nervous a few new model of macOS breaking any instruments, we will additionally set any newly obtainable updates discovered above to mechanically set up, sort:
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true
This subsequent command will will let you set up macOS updates that require a restart.
sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool true
Clear DNS cache
Whenever you load a web site, macOS shops its IP deal with in a neighborhood DNS cache. This behind-the-scenes database permits Safari and different browsers to resolve domains quicker, skipping the necessity for a full DNS lookup each go to.
Whereas it’s uncommon, sometimes, the cache can change into outdated or bloated over time, resulting in points like gradual web page masses or errors equivalent to “DNS Server Not Responding.” macOS does flush the DNS cache mechanically sometimes, however you possibly can manually drive a refresh when troubleshooting connectivity issues or after altering DNS settings.
To manually flush the DNS cache, enter the next instructions so as:
sudo killall -HUP mDNSResponder
(password required)sudo killall mDNSResponderHelper
sudo dscacheutil -flushcache
Create an ASCII artwork banner
Lastly, and only for enjoyable, Terminal may make you ASCII artwork banners. Sort:
banner -w 40 9to5Mac
Be at liberty to switch 9to5Mac with no matter phrase or phrase you want. You can even mess around with the quantity, which pertains to the width of the banner.

Remark beneath in case you discovered any of those helpful. Are there any I ought to add in a pt.3?
Follow Arin: Twitter/X, LinkedIn, Threads
FTC: We use revenue incomes auto affiliate hyperlinks. Extra.