1. Use Caffeinate to prevent your Mac from running screen saver and sleepCaffeinate can prevent your Mac from going to sleep, and screen saver won't activate. We'd better use-t to add a specific time to the command. For example, the following command can make the Mac not sleep in an hour. Caffeinate-t 36002. Using Pkgutil to extract pkg filesIf you want to view a special file in the PKG installation file, you can do so using the Pkgutil command. The following command extracts the macx.pkg file to the desktoppkgutil--expand macx.pkg ~/desktop/3. Use the Purge command to free up memoryThe Purge command clears both the memory and the hard disk cache, similar to the effect of restarting the Mac. The Purge command allows inactive system memory to be converted into memory that can be used. You just need to enter the following command in the terminal. Purge4. Use the Open command to open multiple identical applicationsThe Open command opens the app in the terminal and uses-N to open multiple identical apps. For example, you can use the following command to open a new safari windowopen-n/applications/safari.app/5. Do not update OS X from the App Storewant to update your system but don't want to open the bloated Mac App Store? The following command can help you to upgrade OS X using a terminal.
- sudo softwareupdate-i-A
- 6. List all downloaded files
- We can use the following command to The downloaded content is listed in the sqlite3 ~/library/preferences/com.apple.launchservices.quarantineeventsv* ' Select Lsquarantinedataurlstring from Lsquarantineevent ' |more
- 7. Use the Chflags command to hide files or folders If you want to hide a file or folder, the Chflags command can be implemented. You just need to fill in the file path, like we're going to hide the Macx folder on the desktop. If you want to see the folder again, simply change the hidden to Nohidden.
- Chflags Hidden ~/desktop/macx
- 8. Auto-Input file path You know that you can get a detailed path to a file by dragging any file from the Finder to a terminal window. When you want to enter a path to a file, you may wish to drag the file to try. 9. Create a password-protected compressed file You can create the Macx.txt file on the desktop as a password-protected compressed file protected.zip by following the command below.
Mac terminal directives commonly used in iOS