Table of Contents
This step-by-step guide explains how to use commands and some tips for mac os x. It covers the required setup, the main actions, and the checks that help prevent common problems.
Mac OS X is built in a user-friendly way so anyone can use the computer regardless of their experience. However, delving underneath OS X's shimmering surface by launching the Terminal, we can unlock many hidden features, perform many advanced tasks, adjust and troubleshoot. Mac computer. In this tutorial we will show you some effective Terminal tips and commands.
Note: Before performing the command operation, we recommend that you backup your computer to avoid unnecessary risks.
Some tips only work for a specific operating system so in the article we have chosen to issue commands that can work with most operating systems like Leopard, Snow Leopard and Lion.
To open the Terminal window, go to Apps> Utilities> Terminal .
Although OS X doesn't really place too many important roles in hidden files and folders, there are still some files and folders hidden by default. This is very normal to avoid user deleting the wrong file and causing unnecessary problems, but if you want to show these hidden files, you just need to enter the following command:
defaults write com.apple.finder AppleShowAllFiles true
To cancel the command, replace True With False .
- How to hide, display files and folders on macOS
If you've ever moved the Dock to the right or left of the screen (depending on the version of OS X you're using), you may see the 2D Dock displayed as above. If you want to enable 2D Dock at all locations, enter the following command in Terminal:
defaults write com.apple.dock no-glass -boolean YES
Now restart the Dock for the changes to take effect by typing
killall Dock
To bring Dock back to normal, replace ' YES ' in the above command with ' NO ' and restart Dock again with the killall command above.
Certainly there will be many people who like Dashboard, but this is the culprit who consumes a lot of RAM resources. If you want to completely disable Dashboard to avoid this and avoid launching it accidentally, use the following command in Terminal and press Return:
defaults write com.apple.dashboard mcx-disabled -boolean YES
Restart the Dock for the changes to take effect.
killall Dock
To cancel the order and return to Dashboard, simply change 'YES' to 'NO' and restart the Dock with killall again.
OS X Lion hides the default Library folder and this makes troubleshooting such as clearing the cache very difficult. To display the Library folder permanently, enter the following command in Terminal:
chflags nohidden ~
If you prefer to hide all icons on the desktop via Terminal, you can use the following command:
defaults write com.apple.finder CreateDesktop -bool false
Next, use killall command
killall Finder
If you want to bring everything back as before, copy and paste the following command:
defaults write com.apple.finder CreateDesktop -bool true
Next, use Killall Command.
To launch apps from Terminal, follow the following form, replace Twitter with the app name you want to launch:
open -a Twitter
If you want to end a process or an app, use the command below, replace Twitter with the process you want to end.
killall Twitter
To quickly open the Finder window in any folder, enter the following command in Terminal
open.
OS X's Screenshot utility is very useful but if you want to save the JPG file, use the following command:
defaults write com.apple.screencapture type jpg
(Note: You can also change jpg to png if you want).
If you need to download files from the Internet without opening the browser, you can download it via Terminal. Previously, TipsMake showed you how to install software using Homebrew, allowing downloading software through the browser. But you can download it via Terminal if there is a direct download link. First, specify the directory to save the downloaded file (here select the Downloads folder).
cd ~ / Downloads /
Next, to download the file, type:
curl -O [File path]
There are many different apps to disable the ability to "sleep" on Macs like Amphetamine, but if you don't like to install a lot of software on your computer, you can use the following Terminal command:
Caffeine
This command will prevent Mac from switching to Sleep mode. If you want to turn it back on, just press Ctrl + C.
- How to set up a Mac doesn't fall into a "sleep" state
If you like Tetris, you can play it on the Mac with the following command:
Emacs
Press the Fn And F10 Keys at the same time, then press the t And g Buttons. You will see the screen below, select the game you want to play and start.
If you like the sound of the iPhone, you can turn the audio plugged in to the same power as the iPhone with the following command:
defaults write com.apple.PowerChime ChimeOnAllHardware -bool true; open /System/Library/CoreServices/PowerChime.app
For better computer security, you should update your Mac regularly, but most users don't pay attention to it and forget to download important patches and updates. In this case you can set up Mac to check for these updates more often.
To set up Mac to check for updates daily, type the following command:
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
On a Mac, when taking screenshots, by default it will save these photos on the desktop. However, for those who need to capture multiple screens, their desktop becomes a mess. There is an easy way to change the location to save this default screenshot. You just need to type the following command, replace / your / location / here With the path to the folder you want to change.
defaults write com.apple.screencapture location ~ / your / location / here
Next, type:
killall SystemUIServer
Another command you can use with Mac screenshots is to change its default name. Normally, Mac will name screenshots like Screen Shot 2018-09-11 at 20. 00. 46. Png , but this name is difficult to find and inconvenient for users. You can replace it with a more recognizable name with the following command:
defaults write com.apple.screencapture name "New screenshot name"
Next, type:
killall SystemUIServer
With this command, you can change the distance between apps in the Dock:
defaults write com.apple.dock persistent-apps -array-add '{"tile-type" = "spacer-tile";}'
Next, type:
killall Dock
The Mac stores your entire download history, to view this entire list, type:
sqlite3 ~ / Library / Preferences / com.apple.LaunchServices.QuarantineEventsV * 'select LSQuarantineDataURLString from LSQuarantineEvent'
To delete download history, enter the following command:
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'
Now if you type the first command again, you will see this list blank, nothing.
To turn off the Mac, enter the following command:
$ sudo shutdown -h now
To restart the Mac, type:
$ sudo shutdown -r now
FAQ
What should I check before following these steps?
Confirm device and software compatibility, save important data, and make sure you have the required permissions, files, and account access.
Why might the process not work?
Common causes include outdated software, missing permissions, incompatible hardware, an unstable connection, or completing a step in the wrong order.
Can I undo the changes if necessary?
That depends on the tool or setting. Use built-in restore options when available, keep a backup, and record the original configuration first.
Reader Comments 0
Sign in with email or Google to join the discussion.