As you know, Apple’s MacBook always possesses many useful features that help optimize the user experience. Especially if you know how to take advantage of Terminal commands on macOS, you will certainly be faster when performing operations. In addition, there is a command to fix the problem and speed up the operation of the machine.
Best Terminal Commands For MacOS
Speed up the mouse pointer
This command will be especially suitable for those using Magic Mouse and feel that the mouse speed is not fast enough, even though set to the maximum level in System Preferences.
Command: defaults write -g com.apple.mouse.scaling X (Replace X with a coefficient that you think is fast enough, so try it a few times to choose the right speed, I usually choose X from 6.0 to 8.0).
Removed the appearance of the dock
Many people like to hide the dock when not in use, but the annoying point here is that when you put the mouse in the dock and wait for it to appear, it is often delayed by less than 1 second because of the effect.
The way to eliminate the delay and make the dock appear immediately is to enter this command in Terminal: defaults write com.apple.Dock autohide-delay -float 0 && killall Dock.
defaults delete com.apple.Dock autohide-delay && killall Dock (Enter this line if you want the effect back to default).
Force the computer to Shut Down and Restart
Sometimes there will be some hidden tasks that prevent us from shutting down, in this case you can force the system to shut down all by going to Terminal and typing: shutdown -r now (If this command still does not work). fix it, add “sudo” to the beginning of the command to launch the command with the highest privileges).
Terminal command turns on and off effects on macOS
Usually, when taking a screenshot of a window, the finished image is often made with a white background with a nice shadow effect.
However, many people don’t want shadow, so they often have to turn it off by typing: defaults write com.apple.screencapture disable-shadow -bool TRUE killall SystemUIServer.
Convert the format of the screenshot
By default, when taking a screenshot on macOS, the image will be saved in the .png format, but sometimes we often work with .jpg more or have needs with other types of image formats.
This is how we change the default format when taking screenshots: defaults write com.apple.screencapture type xxx (You copy paste and replace the xxx part with the required format, for example jpg png or pdf…).
Change where screenshots are saved
You can specify where the screenshot will be saved by typing defaults write com.apple.screencapture location ~/your/location/here and replacing the phrase your location here with a specific place, I usually leave it to the desktop to continue working on that snapshot, for example.
Prevent the machine from Sleep under any conditions
To prevent the machine from going to sleep no matter what conditions we are setting up to use the machine, we have a cool command called caffeineate. Enter the command caffeineate or caffeineate -t xxx.
Turn off the sound when charging
Apple’s removal of the MagSafe charging port makes the charging tone important for us to know if the device is receiving power, but many of you will want to turn it off or miss a sound error and want to open it again:
- To disable: defaults write com.apple.PowerChime ChimeOnAllHardware -bool FALSE; killall PowerChime
- To open: defaults write com.apple.PowerChime ChimeOnAllHardware -bool TRUE; open /System/Library/CoreServices/PowerChime.app &
Turn off the machine startup sound
There was a time when this startup sound was removed from default by Apple, but on new versions of macOS it is back. If you don’t like it and want to turn it off for less trouble, type the command: sudo nvram StartupMute=%01.
Change how often you check for macOS updates
Normally, macOS will automatically check for updates once a day, but if you want to change it to 2 or 3 days to check for updates, you can use the following command line to adjust:
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ScheduleFrequency X (X is the number of days you want the machine to check, for example X = 1 every day, X = 7 it takes 7 days to check).
Show hidden files and folders in Finder
If you want to mess around, you can use the command below to show hidden files and folders. So you need this command: defaults write com.apple.finder AppleShowAllFiles -bool TRUE killall Finder (To change the show and hide states, you just need to change True and False together).
With 11 terminal commands on macOS, you can optimize features and useful operations right on your MacBook. I wish you a successful application and do not forget to share the article with friends and relatives for reference!