This guide is about the 9 Command Line Tricks for Mac OS X You Should Know. I will try my best so that you understand this guide very well. I hope you all like this guide 9 Command Line Tricks for Mac OS X You Should Know.
The command line is often seen as an advanced user dimension, but that doesn’t mean you have to have rocket science every time you use the Terminal. This collection of terminal tips should apply to a wide variety of Mac users, and everyone from beginners to advanced users should find something useful here.
Some of these tricks may require you to install Xcode on your Mac, Xcode is a free download from the App Store.
Prevent screensavers and sleeping with caffeine
The new caffeine in OS X Mountain Lion is like a command line version of everyone’s favorite caffeine utility. Operation is simple, while caffeine is running, the Mac does not sleep and the screen savers are not activated. At its simplest, it can be used alone, but it is probably best to use it within the time limit set for it like this:
caffeate -t 3600
The -T flag specifies the time in seconds, the example above uses caffeate for an hour.
Extract the PKG files with a pkgut account
Need to grab a file from a .pkg file? Maybe you want to see what’s inside a pound without installing it? No Sweat, pkgutil does the job:
pkgutil – expand the sample. pkg ~ / Desktop /
This drops the entire pkg content to the specified directory without installing it.
Use “purge” to free memory
The wipe command forcibly flushes the disk and memory caches, which has a similar effect as restarting the Mac. While some say that cleanup only provides a placebo effect, it definitely works by sending system memory from the “passive” class back to freely available RAM, and in situations where actual memory is low, it can increase speed.
Using cleaning is simple, type the following at a command prompt:
Wait a few minutes for the changes to take effect, the process is usually much faster on Macs with SSDs.
Launch multiple applications in “open”
You may already know that you can open applications in the OS X interface from the command line with the ‘open’ command, but did you know that you can run multiple applications by appending the -n flag to an open command? It’s easy to use, here’s everything you need to do:
open -n /Applications/Safari.app/
In the example, another instance of Safari is run. Rename the application accordingly and don’t forget to include the .app extension.
Upgrading OS X without the App Store
Want to install system software and updates effortlessly in the Mac App Store? You can do this directly from the command line using the softwareupdate command instead. To install all available updates, just do the following:
sudo softwareupdate -i -a
You can read more about software update commands here, it has been included with OS X for years and works the same no matter what version you are using.
A list of everything you’ve ever downloaded
We have all been there; you downloaded something some time ago from a domain that you kind of remember but don’t quite remember what or where. You’re in luck because Quarantine Services keeps a database of everything you’ve ever downloaded, and you can query the database to find what you’re looking for. Use the sqlite3 command to see everything:
sqlite3 ~ / Library / Preferences / com.apple.LaunchServices.QuarantineEventsV * ‘select LSQuarantineDataURLString from LSQuarantineEvent’ | more
Of course, you can also delete the list if existence bothers you.
Hide files or folders from the Finder with chflag
Do you have a secret file or folder that you want to hide from the Finder? Use chflages to compile any files invisible from the OS X GUI file system, it works the same way you point to a file or a directory:
chflags hidden / path / file / or / folder /
Lucky (or unlucky) for us on the command line, the file is still visible in ls, but it will remain hidden in the Finder until the “nohidden” flag is attached like this:
chflags nohidden / path / / hide /
The changes are immediate in both cases.
Automatically drag and drop long paths
Did you know that you can drag and drop any file from the Finder to the command line, and the full path to the file will be printed automatically? This is not just a command line tip, but it is so useful that it needs to be included. This is probably best used with the path prefix command, such as:
sudo vi (drag the file here to print the full path)
This works anywhere on the command line, even if you are already in the application.
Create a password-protected zip archive
If you upload a file over unprotected media or host it publicly, but still want to provide some protection, you can create a password-protected zip archive with the -e flag:
zip -e protected. zip / file / protect /
Without the -e flag, you will only create a regular zip file without a password.
Benefits: 9 Command Line Tricks for Mac OS X You Should Know
- The 9 Command Line Tricks for Mac OS X You Should Know guide is free to read.
- We help many internet users follow up with interest in a convenient manner.
- The price of the 9 Command Line Tricks for Mac OS X You Should Know guide is free.
FAQ: 9 Command Line Tricks for Mac OS X You Should Know
Guide about 9 Command Line Tricks for Mac OS X You Should Know
In this guide, I told you about the 9 Command Line Tricks for Mac OS X You Should Know.
How this Guide helping you?
In this guide, I discuss about the 9 Command Line Tricks for Mac OS X You Should Know, which is very helpful.
What are the supported devices for this guide?
Apple Devices only.
What are the supported Operating system?
mac OS or iOS
Final note: 9 Command Line Tricks for Mac OS X You Should Know
If you have any queries regards the 9 Command Line Tricks for Mac OS X You Should Know, then please ask us through the comment section below or directly contact us.
Education: This guide or tutorial is just for educational purposes.
Misinformation: If you want to correct any misinformation about the guide “9 Command Line Tricks for Mac OS X You Should Know”, then kindly contact us.
Want to add an alternate method: If anyone wants to add more methods to the guide 9 Command Line Tricks for Mac OS X You Should Know, then kindly contact us.
Our Contact: Kindly use our contact page regards any help.