Command line access to which is usually possible through the application "Terminal", it is generally considered the lot advanced users, but it does not mean that it is any incredibly complicated thing in itself. This proves the following selection of terminal capabilities, which may be useful to a wide range of makovodov.
Command line access to which is usually possible through the application "Terminal", it is generally considered the lot advanced users, but it does not mean that it is any incredibly complicated thing in itself. This proves the following selection of terminal capabilities, which may be useful to a wide range of makovodov.
Some of these opportunities may require an in Xcode system that can be set free from Mac App Store (Compelled to warn, however, that it weighs quite a lot).
Prevent the launch of the screensaver and go into sleep mode using caffeinate
Introduced in OS X Mountain Lion is a console command caffeinate analogue of the well-known tools Caffeine. The principle of operation is very simple - running the caffeinate your Mac will not go to sleep or to activate the screensaver. It can be run without any additional parameters, but you can limit the time of its operation timer, for example ::
caffeinate -t 3600
Flag -t exposes the time in seconds, the above example launches caffeinate for 1 hr.
Extract the files from the PKG using pkgutil
There is a need to pull a file from a batch file .pkg? Or to see the contents of PKG without installation? Use pkgutil:pkgutil --expand package.pkg ~ / Desktop /
Free up some memory purge
purge command forcibly clears the disk cache and memory cache, which gives an effect similar to rebooting a computer. While some say that the purge is likely a placebo effect, she copes with the fact, to get out of system memory category of "inactive" in the category of "available", which adds speed system in situations where memory is on outcome.
Use this command is very simple :)purge
... and wait a bit until the changes take effect, it is usually faster to "Macs" with SSD.
Use the open to run multiple copies of the same application
Perhaps you already know that you can run from Terminal GUI application, Using the open command, but did you know that you can run multiple copies of the application, simply by adding -n flag?open -n /Applications/Safari.app/
This example starts a new copy of Safari.
Update OS X without the App Store
Want to upgrade without having to run is not always rapid application Mac App Store? It has a command line and the command softwareupdate:sudo softwareupdate -i -a
See a list of all files ever you downloaded from the Net
Forgot that where you have appeared in the "Downloads" folder? Quarantine is a system service in its database record of all your downloads, and you just have to ask her to sotvetstvuet request. Sqlite3 command with the following options will lead you to the full list:sqlite3 ~ / Library / Preferences / com.apple. LaunchServices. QuarantineEventsV * 'select LSQuarantineDataURLString from LSQuarantineEvent' | more
If you are "straining" the existence of these records, they can be cleaned with the following command:sqlite3 ~ / Library / Preferences / com.apple. LaunchServices. QuarantineEventsV * 'delete from LSQuarantineEvent'
Hide files and folders from the Finder using chflags
Do you want to hide from the eyes of random file or folder? Use chflags, to make them invisible to the OS X GUI:chflags hidden / path / to / file / or / folder /
Fortunately (or unfortunately), a hidden object is still visible with the ls command. To return the "visibility" use flag nohidden:chflags nohidden / path / to / unhide /
Automatic replacement of long paths by dragging
If you drag and drop any file from the Finder to the Terminal, vystvetitsya its full path in the command line. The best use of this function - in combination with some, such as editing commands:sudo vi (drag and drop a file here to paste the path)
Create password-protected Zip archive
When sending of files, such as e-mail attachments, it is useful protect them. The easiest way - to put them in an archive file, password protected, which is necessary to use the flag -e:zip -e protected.zip / file / to / protect /
Without the -e flag, this command will create a regular unprotected file.
Have a favorite trick in Terminal? Tell us about it in the comments!