Use commands and some tips for Mac OS X
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 Applications> Utilities> Terminal .
Some useful Terminal commands on macOS
- 1. Show hidden files
- 2. Activate 2D Dock
- 3. Disable Dashboard
- 4. Display Library folder in OS X Lion
- 5. Hide desktop icons
- 6. Launch the application
- 7. End a process
- 8. Open the Finder window in the current directory
- 9. Change the default screenshot format
- 10. Download files from the Internet without a browser
- 11. Turn off Sleep mode on Mac
- 12. Play Tetris game hidden on Mac
- 13. Turn the audio plugged into the power on the Mac just like the iPhone
- 14. MacOS settings check for updates more frequently
- 15. Change the location to save the screenshot
- 16. Create the default name for the screenshot
- 17. Add distance between applications in Dock
- 18. View the entire download history and delete it
- 19. Turn off the Mac
1. Show hidden files
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
2. Activate 2D Dock
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.
3. Disable Dashboard
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.
4. Display Library folder in OS X Lion
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 ~ / Library /
5. Hide desktop icons
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
Then 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
Then use killall command.
6. Launch the application
To launch applications from Terminal, follow the following form, replace Twitter with the application name you want to launch:
open -a Twitter
7. End a process
If you want to end a process or an application, use the command below, replace Twitter with the process you want to end.
killall Twitter
8. Open the Finder window in the current directory
To quickly open the Finder window in any folder, enter the following command in Terminal
open.
9. Change the default screenshot format
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).
10. Download files from the Internet without a browser
If you need to download files from the Internet without opening the browser, you can download it via Terminal. Previously, Quantrimang 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 /
Then to download the file, type:
curl -O [File path]
11. Turn off Sleep mode on Mac
There are many different applications 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
12. Play Tetris game hidden on Mac
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.
13. Turn the audio plugged into the power on the Mac just like the iPhone
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
14. MacOS settings check for updates more frequently
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
15. Change the location to save the screenshot
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
Then type:
killall SystemUIServer
16. Create the default name for the screenshot
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"
Then type:
killall SystemUIServer
17. Add distance between applications in Dock
With this command, you can change the distance between applications in the Dock:
defaults write com.apple.dock persistent-apps -array-add '{"tile-type" = "spacer-tile";}'
Then type:
killall Dock
18. View the entire download history and delete it
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.
19. Turn off the Mac
To turn off the Mac, enter the following command:
$ sudo shutdown -h now
To restart the Mac, type:
$ sudo shutdown -r now
I wish you all success!
See more:
- 7 commands to manipulate the most basic files and folders everyone must know
- 10 troubleshooting tips for Mac OS X
- Instructions to enable hidden features for dock on Mac OS
You should read it
- 6 interesting terminal commands on Mac
- How to use Terminal on a Mac
- 18 terminal commands on Chromebook you should know
- How to run 2 or more Terminal commands at the same time on Linux
- Common Terminal commands in Raspberry Pi
- How to get an explanation of the command in a terminal with Kmdr
- How to Customize Your Mac Using the Terminal
- Guide to network operation for Linux users: 11 commands to know
- How to set Windows Terminal to always open with Command Prompt on Windows 11
- 8 best free Terminal Emulator apps for Android
- 14 interesting Linux commands in Terminal
- 7 commands to manipulate the most basic files and folders everyone must know
Maybe you are interested
How to use the file search command on Windows, find saved files
Why is tldr command better than man command in Linux?
Should I use PowerShell or Command Prompt?
What to do when open command window here does not appear?
How to switch users on the Linux command line
How to fix Mac Homebrew error 'zsh: command not found: brew'