Command Line

Search Command Line

How to Tell If Someone Was Using Your Mac

Feb 25, 2012 - 8 Comments
Find the last wake time

Although everyone should always password protect a Mac to prevent unauthorized use, not everyone does. Sometimes people share general logins, be it with a roommate, sibling, spouse or whoever else. Now, if you have ever wondered if someone was using your computer while you were away, there’s actually a pretty easy method to find out … Read More

IR_Black Theme Add Colors Easily to the Terminal in Mac OS X

Feb 24, 2012 - 7 Comments
IR_Black theme for OS X Terminal

We recently covered the classic method of adding colors to the command line by editing .bash_profile, but it turns out that Terminal in OS X Lion and OS X Mountain Lion both support custom ANSI colors, giving the ability to easily change the ansi color scheme through external theme files. One such color scheme is … Read More

Add Color to the Terminal in Mac OS X

Feb 21, 2012 - 22 Comments
Dark Terminal Colors

Adding colorized ls output to the Terminal in Mac OS X is a good way to make navigating around the command line a bit easier on the eyes. This makes different items show up in different colors, including directories, files, executables, and symbolic links.

Verify SHA1 Hash with openssl

Feb 9, 2012 - 2 Comments

An alternative to checking a SHA1 hash with shasum is to use openssl. Yes, the same openssl utility used to encrypt files can be used to verify the validity of files. The syntax is quite similar to the shasum command, but you do need to specify ‘sha1’ as the specific algorithm like so:

Check SHA1 Checksum in Mac OS X

Feb 5, 2012 - 10 Comments
Mac Terminal icon

SHA hashing is frequently used with distribution control systems to determine revisions and to check data integrity by detecting file corruption or tampering. For common usage, a SHA checksum provides a string that can be used to verify a file been transferred as intended. If SHA checksums match, the files integrity has been maintained. This … Read More

Reindex Spotlight from the Command Line in Mac OS X

Feb 2, 2012 - 9 Comments
Spotlight

Spotlight is generally very good at keeping a valid index of a drives contents up to date, but if you’ve recently restored a drive or had to delete the Spotlight index for one reason or another, you may need to reindex the drive manually. This is easy from the Spotlight control panel, and can also … Read More

See All Previously Used Defaults Commands in Mac OS X

Jan 31, 2012 - 8 Comments
defaults history

It’s easy to lose track of all the defaults commands used to perform tweaks to Mac OS X, but with the help of the history command it’s easy to list every defaults write and accompanying defaults delete commands ever used on a Mac. Launch the Terminal to get started. See All Defaults Commands Executed To … Read More

Encrypt & Decrypt Files from the Command Line with OpenSSL

Jan 30, 2012 - 10 Comments
Encrypted file

Need to quickly encrypt a file from the command line? With OpenSSL, you can encrypt and decrypt files very easily. For the purpose of this walkthrough, we’ll use des3 encryption, which in simple terms means a complex encryption algorithm is applied three times to each data block, making it difficult to crack through brute force … Read More

See Sizes in Human Readable Format from the Command Line

Jan 25, 2012 - 2 Comments
Human readable format

The default behavior for most command line tools is to show sizes in bytes, for tiny text files that is fine but when you start working with larger items this becomes difficult to read and interpret. The solutions is fairly simple, pass a “human readable” flag with the command, which will convert bytes to a … Read More

Compare Time Machine Backups and List All Changes Between Backups

Jan 21, 2012 - 4 Comments
tmutil compare output

Modern versions of Mac OS X include a great tool called tmutil that lets you interact with with Time Machine from the command line. It’s a powerful utility that has a ton of options, and we’ve used it before to disable local snapshots, but for the purposes here we are going to use tmutil to … Read More

Monitor Disk Activity in Mac OS X

Jan 20, 2012 - 3 Comments
Monitor Disk Activity in Mac OS X

You can monitor disk activity in Mac OS X by using the Activity Monitor app or several command line tools. Activity Monitor is the easiest and most user friendly, but the Terminal options allow further information to be retrieved.

Discover What Apps or Processes are Interacting with a File in Mac OS X

Jan 13, 2012 - 3 Comments
Watch what apps are using a file with lsof or opensnoop

Using the lsof command, we can find out exactly what process or application is using a specified file at that given moment. This is similar to the opensnoop command, but rather than watching the changes to a file over time, lsof can give us a snapshot of this very moment, which can be helpful for … Read More

How to Install Kernel Extensions in Mac OS X Manually

Jan 12, 2012 - 11 Comments
Kext files

Advanced Mac OS X users may find it useful to know that KEXT (kernel extensions) can be manually installed. The process of installing kexts manually into OS X is not too difficult if you’re comfortable with the command line, but it is a multi-step process of copying the appropriate .kext file to the appropriate kernel … Read More

Password Protect Zip Files in Mac OS X

Jan 7, 2012 - 63 Comments
Zip Password in Mac OS X

Creating a password protected zip file is easy in Mac OS X and does not require any add-ons or downloads. Instead, use the zip utility that is bundled with all Macs. This offers a simple way to protect a zip archive file from unwanted viewing access, as when a user attempts to decompress the contents … Read More

Open New man Page Windows from an Existing Terminal in OS X

Jan 2, 2012 - 2 Comments
open a man page from the Terminal in OS X

The Mac OS X Terminal includes a great feature that lets you quickly access new manual pages from any existing Terminal window.

Open a New Terminal From the Current Finder Directory With Go2Shell

Dec 21, 2011 - Leave a Comment
Go2Shell

Go2Shell is a free Finder toolbar add-on that creates a new Terminal window from the current directory of any desktop folder in Mac OS X with a click of a button. This is similar to the services option that can be added to the right-click contextual menu, but Go2Shell is faster due to resting in … Read More

Mount a DMG from the Command Line in Mac OS X

Dec 17, 2011 - 17 Comments
Mount a DMG from the Command Line in Mac OS X

A helpful command line tool called hdiutil is included in Mac OS X that allows disk image files (.dmg extension) to be mounted directly from the Terminal, without the need of using the GUI. Using hdiutil for such a task is helpful for scripting or remote connections through SSH.

How to Disable (or Enable) Spotlight in Mac OS X Mavericks & Mountain Lion

Dec 10, 2011 - 74 Comments
Enable Spotlight in OS X Lion

Completely disabling and reenabling Spotlight in Mac OS X Lion, OS X Mountain Lion, and OS X Mavericks can be done with the help of the Terminal. The following command unloads the Spotlight mds agent from launchd, thereby preventing the daemon from running or indexing any drives entirely. Open up the Terminal (found in /Applications/Utilities/) … Read More

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site