20 teams "Terminal" in the MacOS, which will be useful
Macos / / December 25, 2019
All functions macOS thought out to the smallest detail and their settings are optimal for most users. However, by choosing "Terminal" system behavior can be changed, and its ability - to expand. And in some cases it can be very useful.
To apply or cancel the setting, run the "Terminal" from the folder "Programs» → «Utility" and enter the following commands, using a combination Cmd + C, Cmd + V.
Show hidden files and folders in the Finder
Infrequently, but still there is a need to delve into the hidden files on the disc. By default, they are not displayed in the Finder, and to see them have to use a special command.
How to turn it on:
defaults write com.apple.finder AppleShowAllFiles -bool TRUE && killall Finder
How to disable:
defaults write com.apple.finder AppleShowAllFiles -bool FALSE && killall Finder
Hidden files and folders
If desired, you can hide from prying eyes private data on the disk. To do this, use the command chflags. After it is necessary to enter the path to the file or folder you want to hide. In order not to bother with the introduction of the way, you can just drive a team, and then drag the window "Terminal" the desired folder.
How to turn it on:
chflags hidden ~ / Desktop / Secret Folder
How to disable:
chflags nohidden ~ / Desktop / Secret Folder
Copying text to the "View"
When you press the space bar in the Finder offers a quick view of files. So it is very convenient to check the contents of text documents. That's only in this box does not work allocation - to copy the text is necessary to open the document. In order not to waste time on it, activate the selection function for quick viewing.
How to turn it on:
defaults write com.apple.finder QLEnableTextSelection -bool TRUE && killall Finder
How to disable:
defaults write com.apple.finder QLEnableTextSelection -bool FALSE && killall Finder
Download files without a browser
To download the file link from the Internet necessarily use Safari or Chrome. Sometimes it's much faster and easier to do through the "Terminal" with the command curl.
How to use:
curl -O https://get.videolan.org/vlc/3.0.3/macosx/vlc-3.0.3.dmg
Creating a file of any size
To test the data transfer rate over the network or from removable media conveniently by copying files. Search for this movie or image of the appropriate size for a long time, so much easier to create a test file using the command mkfile. Select a desired size by using numbers and symbols b, k, m or g, Meaning bytes, kilobytes, megabytes and gigabytes, respectively.
How to use:
mkfile 1g test.abc
View all active processes
To monitor system resources macOS there is a program that is called. It is quite convenient and informative, but it might as well see the most resource-intensive processes can be in the "Terminal".
How to use:
top
Disabling the shadow of the screenshots
A distinctive feature of the screenshots in macOS are beautiful shadows around them. In some situations, they interfere and want to remove. To do this, simply enter the following command.
How to disable:
defaults write com.apple.screencapture disable-shadow -bool TRUE && killall SystemUIServer
How to turn it on:
defaults write com.apple.screencapture disable-shadow -bool FALSE && killall SystemUIServer
Changing the format of screenshots
By default, screenshots are saved to PNG. This format allows you to achieve high quality, but requires a lot of space for files. If you frequently export captured screenshots from PNG to JPG, you can save time, you can configure the preservation immediately to JPG.
How to turn it on:
defaults write com.apple.screencapture type JPG && killall SystemUIServer
How to disable:
defaults write com.apple.screencapture type PNG && killall SystemUIServer
In addition to JPG, MacOS can also choose TIFF or, for example, PDF.
Repositioning save screenshots
Take lots of pictures of the screen and does not have time to remove them from the desktop? Create a separate folder and save screenshots in it. And to help in this is such a team.
How to use:
defaults write com.apple.screencapture location ~ / Desktop / Screenshots && killall SystemUIServer
How to bring back:
defaults write com.apple.screencapture location ~ / Desktop && killall SystemUIServer
Acceleration dock animation
When you need to focus on the work, it is convenient to hide the dock and open it, putting the mouse over the bottom of the screen. By default, the panel appears with a delay of 0.7 seconds, but it is easy to change. Noticeable acceleration is observed even at a delay of 0.5 seconds. But if that much, you can remove the delay completely, put a zero.
How to turn it on:
defaults write com.apple.dock autohide-time-modifier -float 0.5 && killall Dock
How to disable:
defaults write com.apple.dock autohide-time-modifier -float 0.7 && killall Dock
Adding a separator in the Dock
The separator at the dock there is only next to the basket, the rest of the icons are displayed in a row. And sometimes, when a lot of them, to find the right becomes quite difficult. Make neater docking, sorting the programs, for example, into categories by using a separator.
How to add:
defaults write com.apple.dock persistent-apps -array-add '{ "tile-type" = "spacer-tile";}' && killall Dock
How to remove:
To remove a separator, simply pull it out of the dock like any other icon, which he, in fact, is.
Message on the lock screen
But this trick will come in handy in case of loss of a computer or to draw colleagues. With this command you can add any text on the logon screen.
How to turn it on:
sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Inquiry"
How to disable:
sudo defaults delete /Library/Preferences/com.apple.loginwindow
pronunciation of the text
In macOS built speech synthesizer that can articulate the specified text. To get the device to speak, you need to enter in the "Terminal" a special team, adding to it the desired text or document path.
How to use:
say "Hello, Layfhaker!"
say -f ~ / Documents / skazka.txt
View calendar
The calendar is displayed in the eponymous application, as well as setting the date and time. Another way to quickly view it - a team cal in the "Terminal". By default, it shows the current month, but if you add to it a year, you can see the full calendar.
How to use:
cal 2018
Exemption of RAM
The system itself copes with memory management, but when RAM clogged the eyeballs and the computer starts to slow down, it is possible to improve the situation by force, clear your app cache. To do this, use the command purgeWhich will require the supervisor password.
How to use:
purge
Checking the Mac operating time
Apple computers running smoothly weeks or even months. Sometimes it is interesting to know how much time has passed since the last. The answer to this question will give the next command.
How to use:
uptime
The ban on the transition to the sleep mode
When on a Mac running any task without pressing any keys and touch the trackpad, through time, the computer goes into sleep mode, and the process is suspended. This can be avoided by prohibiting the transition to this mode using the settings or use special tools. However, there is an easier way - team caffeinate.
How to turn it on:
caffeinate
How to disable:
To return to the current settings of energy saving should be left to the implementation process in the "Terminal" by using the keyboard shortcut Ctrl + C.
Mac Stress test
If your computer crashes and the problem occurs only under load, it can be easily identified with the following command. It loads all cores at 100% as long as you do not stop its execution.
How to turn it on:
yes> / dev / null && yes> / dev / null && yes> / dev / null && yes / dev / null &&
How to disable:
killall yes.
Instant restart or shutdown
Standard shutdown Mac requires the preservation of all open documents and takes more time. If you are sure that everything is saved, and you want to without delay switch off your computer - use the following commands.
To turn off type:
sudo shutdown -h now
To reboot:
sudo shutdown -r now
Automatic restart when suspended
Occasionally it happens that the Mac may hang and stop responding. In this case, you must force restart your computer while holding down the power button. After entering this command, the system will automatically restart after a crash.
How to turn it on:
sudo systemsetup -setrestartfreeze on
How to disable:
sudo systemsetup -setrestartfreeze off
see also
- 3 tools which purify Mac of all superfluous →
- 11 programs for MacOS, that should be in every →
- What if the brakes Mac →