<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OS X Daily &#187; Command Line</title>
	<atom:link href="http://osxdaily.com/category/command-line/feed/" rel="self" type="application/rss+xml" />
	<link>http://osxdaily.com</link>
	<description>News, tips, software, reviews, and more for Mac OS X, iPhone, iPad</description>
	<lastBuildDate>Sat, 11 Feb 2012 20:32:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Verify SHA1 Hash with openssl</title>
		<link>http://osxdaily.com/2012/02/09/verify-sha1-hash-with-openssl/</link>
		<comments>http://osxdaily.com/2012/02/09/verify-sha1-hash-with-openssl/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 13:54:18 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[sha1]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=26869</guid>
		<description><![CDATA[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 &#8216;sha1&#8242; as the specific algorithm: openssl sha1 /path/to/filename To [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p>An alternative to <a href="http://osxdaily.com/2012/02/05/check-sha1-checksum-in-mac-os-x/">checking a SHA1 hash with shasum</a> is to use openssl. Yes, the same openssl utility used to <a href="http://osxdaily.com/2012/01/30/encrypt-and-decrypt-files-with-openssl/">encrypt files</a> can be used to verify the validity of files. </p>
<p>The syntax is quite similar to the shasum command, but you do need to specify &#8216;sha1&#8242; as the specific algorithm:</p>
<p><code>openssl sha1 /path/to/filename</code></p>
<p>To verify a file on the desktop, the command would look like this:</p>
<p><code>openssl sha1 ~/Desktop/DownloadedFile.dmg</code></p>
<p>The output isn&#8217;t quite as nice as shasum, but it remains easy to interpret:</p>
<p><code>$ openssl sha1 ~/Desktop/DownloadedFile.dmg<br />
SHA1(/Users/OSXDaily/Desktop/DownloadedFile.dmg)= ba33b60954960b0836daac20b98abd25a21618da3</code></p>
<p>For the average user, there isn&#8217;t much advantage to use openssl over shasum when verifying checksums, so it&#8217;s mostly a matter of habit and whichever is most convenient.</p>
<p><em>Thanks to those readers who recommended this.</em></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/02/09/verify-sha1-hash-with-openssl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Check SHA1 Checksum in Mac OS X</title>
		<link>http://osxdaily.com/2012/02/05/check-sha1-checksum-in-mac-os-x/</link>
		<comments>http://osxdaily.com/2012/02/05/check-sha1-checksum-in-mac-os-x/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 18:27:37 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[checksum]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[md5]]></category>
		<category><![CDATA[sha1]]></category>
		<category><![CDATA[shasum]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=26816</guid>
		<description><![CDATA[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. Checking [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/02/check-sha1-hash.jpg" alt="Check SHA1 Hash Checksum in Mac OS X" title="check-sha1-hash" width="620" height="136" class="aligncenter size-full wp-image-26873" /></p>
<p>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.</p>
<h2 style="font-size:1.2em;">Checking SHA1 Hash in Mac OS X</h2>
<p>Launch the Terminal, found within the Applications and Utilities folder, and use the following syntax:</p>
<p><code>shasum /path/to/file</code></p>
<p>To verify a file named &#8220;DownloadedFile.dmg&#8221; on the desktop, it would be:</p>
<p><code>shasum ~/Desktop/DownloadedFile.dmg</code></p>
<p>This will output something like this:</p>
<p><code>$ shasum ~/Desktop/CheckMe.zip<br />
ddfdb3a7fc6fc7ca714c9e2930fa685136e90448  CheckMe.zip</code></p>
<p>That long hexadecimal string is the SHA1 hash.</p>
<p>An easy way to check SHA1 files buried deep in the file system without typing out the full path, is to type the first part of the command then drag and drop the file into the Terminal window. This <a href="http://osxdaily.com/2011/03/02/drag-drop-finder-items-into-the-terminal-for-their-full-path/">automatically types the path</a> for you:</p>
<p><code>shasum (drag and drop file here)</code></p>
<p>Remember to put a space after &#8220;shasum&#8221; for this to work properly.</p>
<p>The default for  the shasum command is to use SHA1, the most common hash type, but this can be changed with the -a flag if necessary to 224, 256, 384, or 512. Also, though SHA1 is becoming more common than MD5, you can still <a href="http://osxdaily.com/2009/10/13/check-md5-hash-on-your-mac/">easily check md5 hash</a> in Mac OS X as well with the md5 command.</p>
<h2 style="font-size:1.1em;">Examples of Using SHA1 to Verify Files</h2>
<p>A practical use that Mac users may encounter is when downloading software updates directly from Apple, who lists the SHA1 hash of each file offered through their servers at the end of each downloads page. You can see such a string highlighted in the screenshot below. This string allows users to easily verify the integrity of their downloads either from Apple or when the file has been hosted on a third party mirror site. </p>
<p><img src="http://osxdaily.com/wp-content/uploads/2012/02/sha1-on-apple-downloads.jpg" alt="SHA1 Checksum on Apple Downloads Page" title="sha1-on-apple-downloads" width="620" height="358" class="aligncenter size-full wp-image-26871" /></p>
<p>This is also how it was discovered that <a href="http://osxdaily.com/2012/02/04/mac-os-x-10-7-3-combo-silently-updated/">OS X 10.7.3 had been quietly updated</a>, and several questions about this spawned this post.</p>
<p>Using SHA1 hash strings are also an easy way to verify file transfers from peer to peer networks and to make sure a download has finished, or that a file was not tampered with somewhere along the line. By knowing the origin SHA1 checksum, you can verify your version of the file(s) in question matches, and determine if the file is indeed valid and has arrived as intended.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/02/05/check-sha1-checksum-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Reindex Spotlight from the Command Line</title>
		<link>http://osxdaily.com/2012/02/02/reindex-spotlight-from-the-command-line/</link>
		<comments>http://osxdaily.com/2012/02/02/reindex-spotlight-from-the-command-line/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 23:47:55 +0000</pubDate>
		<dc:creator>Paul Horowitz</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[mdimport]]></category>
		<category><![CDATA[mdutil]]></category>
		<category><![CDATA[spotlight]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=26091</guid>
		<description><![CDATA[Spotlight is generally very good at keeping a valid index of a drives contents up to date, but if you&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/spotlight.jpg" alt="Spotlight" title="spotlight" width="200" height="202" class="alignright size-full wp-image-26760" /> Spotlight is generally very good at keeping a valid index of a drives contents up to date, but if you&#8217;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 <a href="http://osxdaily.com/2012/01/17/rebuild-spotlight-index/">easy from the Spotlight control panel</a>, and can also be achieved through the command line as we&#8217;ll demonstrate.</p>
<h2 style="font-size:1.2em;">Reindexing Spotlight from the Command Line</h2>
<p>Reindexing Spotlight from the command line is done with the mdutil tool, first launch Terminal and then type:</p>
<p><code>sudo mdutil -E /</code></p>
<p>This will reindex every mounted volume on the Mac, including hard drives, disk images, external drives, etc. Specific drives can be chosen by pointing to them in /Volumes/, to only rebuild the primary Macintosh HD:</p>
<p><code>sudo mdutil -E /Volumes/Macintosh\ HD/</code></p>
<p>To reindex an external drive named &#8220;External&#8221; the command would be:</p>
<p><code>sudo mdutil -E /Volumes/External/</code></p>
<p>Use of the mdutil command will spin up <a href="http://osxdaily.com/2010/08/05/mds-mac/">mds</a> and <a href="http://osxdaily.com/2009/09/14/mdworker-what-is-mdworker/">mdworker</a> processes as Spotlight goes to work. </p>
<p><strong>Individually Reindexing Selected Files</strong><br />
In rare cases, Spotlight can miss a file during index, so rather than reindex an entire drive you can also manually add an individual file to the search index with the mdimport command:</p>
<p><code>mdimport /path/to/file</code></p>
<p>The mdimport command can be used on directories as well.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/02/02/reindex-spotlight-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>See All Previously Used Defaults Commands in Mac OS X</title>
		<link>http://osxdaily.com/2012/01/31/see-all-previously-used-defaults-commands/</link>
		<comments>http://osxdaily.com/2012/01/31/see-all-previously-used-defaults-commands/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 18:29:19 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[defaults]]></category>
		<category><![CDATA[defaults write]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=26635</guid>
		<description><![CDATA[It&#8217;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&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/defaults-history.jpg" alt="defaults history" title="defaults-history" width="620" height="254" class="aligncenter size-full wp-image-26636" /></p>
<p>It&#8217;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&#8217;s easy to list every <a href="http://osxdaily.com/tag/defaults-write/">defaults write</a> and accompanying defaults delete commands ever used on a Mac. Launch the Terminal to get started.</p>
<h2 style="font-size:1.2em;">See All Defaults Commands Executed</h2>
<p>To see all defaults commands, including defaults write, defaults read, defaults delete, and even those requiring sudo:</p>
<p><code>history |grep "defaults"</code></p>
<p>Will return something like this:</p>
<p><code style="font-size:95%;">   47  sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName<br />
   48  sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo IPaddress<br />
   98  defaults write com.apple.DiskUtility DUDebugMenuEnabled 1<br />
  206  defaults write com.apple.Safari IncludeInternalDebugMenu 1<br />
  237  defaults write com.apple.dock itunes-notifications -bool TRUE;killall Dock<br />
  238  defaults delete com.apple.dock itunes-notifications<br />
  239  defaults write com.apple.dock desktop-picture-show-debug-text -bool TRUE;<br />
  241  defaults delete com.apple.dock desktop-picture-show-debug-text;killall Dock</code></p>
<h2 style="font-size:1.2em;">See Only Defaults Write Commands</h2>
<p>To see only defaults write commands, including those requiring sudo:</p>
<p><code>history |grep "defaults write"</code></p>
<p>The results will look the same as above, but without showing any defaults read or defaults delete commands.</p>
<h2 style="font-size:1.2em;">See Only Defaults Delete Commands</h2>
<p>To see which defaults write commands have been reverted, grep for &#8216;delete&#8217; rather than &#8216;write&#8217;:</p>
<p><code>history |grep "defaults delete"</code></p>
<h2 style="font-size:1.2em;">See Defaults Commands Related to Specific App</h2>
<p>By changing the text within grep to an application or process name, we can see which defaults commands were used only for that specific application. For example, to see only defaults commands that impacted the Finder:</p>
<p><code>history |grep "defaults write com.apple.finder"</code></p>
<p>Most apps are easy to find this way, and the default applications in OS X almost always follow the &#8216;com.apple.appname&#8217; convention.</p>
<p>We touched on this concept before in a <a href="http://osxdaily.com/2011/02/06/print-and-query-command-history-to-find-past-commands/">past post about the history command</a>, but focusing on defaults commands is useful enough to deserve individual recognition. </p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/31/see-all-previously-used-defaults-commands/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Encrypt &amp; Decrypt Files from the Command Line with OpenSSL</title>
		<link>http://osxdaily.com/2012/01/30/encrypt-and-decrypt-files-with-openssl/</link>
		<comments>http://osxdaily.com/2012/01/30/encrypt-and-decrypt-files-with-openssl/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 21:00:41 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[decrypt]]></category>
		<category><![CDATA[encrypt]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=26572</guid>
		<description><![CDATA[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&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/encrypt-file-openssl.jpg" alt="Encrypt and Decrypt files with OpenSSL" title="encrypt-file-openssl" width="620" height="246" class="aligncenter size-full wp-image-26580" /></p>
<p>Need to quickly encrypt a file from the command line? With OpenSSL, you can encrypt and decrypt files very easily. </p>
<p>For the purpose of this walkthrough, we&#8217;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 methods. While we&#8217;re focusing on Mac OS X here, these commands will work anywhere that OpenSSL is installed, including older versions of OS X and Linux.  </p>
<h2 style="font-size:1.3em;">Encrypting Files with OpenSSL</h2>
<p>The syntax of openssl is basic:</p>
<p><code>openssl [encryption type] -in [file to encrypt]</code></p>
<p>As mentioned before, we&#8217;ll use des3 for the encryption, and we&#8217;ll be using a text file as the input. We&#8217;re also going to specify a different output file to prevent any errors. Here is what the command would look like:</p>
<p><code>openssl des3 -in file.txt -out encrypted.txt</code></p>
<p>You will be asked to set and confirm a password before the encryption is complete, do not lose this password or you will lose access to the file.</p>
<p><em>Sidenote</em>: You can also just use an input file with -in filename, but that may cause issues. To prevent any unexpected problems, do not specify the same file as the input and output. This means the original file will stick around either before or after encryption, and you will want to deal with that file individually, preferably through a secure delete method. </p>
<h2 style="font-size:1.3em;">Decrypting Files with OpenSSL</h2>
<p><code>openssl des3 -d -in encrypted.txt -out normal.txt</code></p>
<p>The previously set password will be required to decrypt the file. </p>
<p>Other than switching the placement of the input and output, where again the original file stays put, the main difference here is the -d flag which tells openssl to decrypt the file.</p>
<p>Naturally, you&#8217;re probably wondering what happens if you try to open an file that has been encrypted with OpenSSL without entering the password? You&#8217;ll probably get an error message, but if you <a href="http://osxdaily.com/2007/05/22/ask-os-x-daily-how-do-i-force-open-a-file/">force open</a> the file with something like TextEdit, you&#8217;ll see the text &#8220;Salted&#8221; followed by a bunch of gibberish like so:</p>
<p><img src="http://osxdaily.com/wp-content/uploads/2012/01/encrypted-file.jpg" alt="Encrypted file" title="encrypted-file" width="565" height="120" class="aligncenter size-full wp-image-26573" /></p>
<p>The file will remain unreadable until it has been decrypted through openssl again. </p>
<p>For more about file security, don&#8217;t miss some of our other posts, including <a href="http://osxdaily.com/2011/01/21/password-protect-mac/">password protecting a Mac</a>, <a href="http://osxdaily.com/2012/01/25/password-protect-external-drive-mac-encrypted-partition/">encrypting partitions</a>, <a href="http://osxdaily.com/2012/01/07/set-zip-password-mac-os-x/">zip archives</a>, <a href="http://osxdaily.com/2012/01/11/password-protect-files-folders-in-mac-os-x/">files and folders in disk images</a>, and even <a href="http://osxdaily.com/2011/04/21/paranoid-about-iphone-ipad-location-tracking-encrypt-your-ios-backups/">encrypting iOS backups</a> to keep sensitive data from an iPhone and iPad secure. </p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/30/encrypt-and-decrypt-files-with-openssl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>See Sizes in Human Readable Format from the Command Line</title>
		<link>http://osxdaily.com/2012/01/25/see-sizes-in-human-readable-format-from-the-command-line/</link>
		<comments>http://osxdaily.com/2012/01/25/see-sizes-in-human-readable-format-from-the-command-line/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 21:32:11 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[df]]></category>
		<category><![CDATA[du]]></category>
		<category><![CDATA[human readable]]></category>
		<category><![CDATA[ls]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=26418</guid>
		<description><![CDATA[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 &#8220;human readable&#8221; flag with the command, which will convert bytes to a [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/human-readable1.jpg" alt="Human readable output" title="human-readable" width="604" height="114" class="aligncenter size-full wp-image-26421" /></p>
<p>The default behavior for most <a href="http://osxdaily.com/category/command-line/">command line</a> 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 &#8220;human readable&#8221; flag with the command, which will convert bytes to a much more meaningful human readable format of kilobytes (kb) , megabytes (mb) , and gigabytes (gb).</p>
<p>Generally, seeing things as human readable is just a matter of <strong>passing an -h flag</strong> along with the command. Three prominent examples are with ls, du, and df:<br />
<code>ls -lh</code></p>
<p><code>df -h</code></p>
<p><code>du -h</code></p>
<p>Read on for some specifics about each:<br />
<span id="more-26418"></span><br />
<strong>ls</strong> &#8211; for the generic list command, you&#8217;ll need to attach -h to another flag, like -l:</p>
<p><code>ls -lh</code></p>
<p><img src="http://osxdaily.com/wp-content/uploads/2012/01/ls-human-readable.gif" alt="human readable ls output" title="ls-human-readable" width="493" height="238" class="aligncenter size-full wp-image-26424" /></p>
<p><strong>df</strong> &#8211; displaying free disk space with df is infinitely more useful when viewed as human readable. While you can also use a lowercase -h the uppercase is even better on the eyes:</p>
<p><code>df -H</code></p>
<p><img src="http://osxdaily.com/wp-content/uploads/2012/01/human-readable-df.gif" alt="Human readable df output" title="human-readable-df" width="435" height="108" class="aligncenter size-full wp-image-26420" /></p>
<p><strong>du</strong> &#8211; displaying disk usage for a specific file, folder, directory, or whatever, is made easier to interpret with -h</p>
<p><code>du -sh */</code></p>
<p><img src="http://osxdaily.com/wp-content/uploads/2012/01/human-readable-du.gif" alt="Human readable du output" title="human-readable-du" width="340" height="154" class="aligncenter size-full wp-image-26423" /></p>
<p><a href="http://osxdaily.com/category/command-line/">Check out more tips and things you can do with the command line</a>.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/25/see-sizes-in-human-readable-format-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Compare Time Machine Backups and List All Changes Between Backups</title>
		<link>http://osxdaily.com/2012/01/21/compare-time-machine-backups-tmutil/</link>
		<comments>http://osxdaily.com/2012/01/21/compare-time-machine-backups-tmutil/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 22:05:56 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[backup Mac]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mac backups]]></category>
		<category><![CDATA[Mac OS X 10.7]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[time machine]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tmutil]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=26270</guid>
		<description><![CDATA[Mac OS X 10.7 Lion includes a great tool called tmutil that lets you interact with with Time Machine from the command line. It&#8217;s a powerful utility that has a ton of options and we&#8217;ve used it before to disable local snapshots, but for the purposes here we are going to use it to compare [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/time-machine.jpg" alt="Time Machine" title="time-machine" width="219" height="239" class="alignright size-full wp-image-26292" /> Mac OS X 10.7 Lion includes a great tool called tmutil that lets you interact with with Time Machine from the command line. It&#8217;s a powerful utility that has a ton of options and we&#8217;ve used it before to <a href="http://osxdaily.com/2011/09/28/disable-time-machine-local-backups-in-mac-os-x-lion/">disable local snapshots</a>, but for the purposes here we are going to use it to compare Time Machine backups. Launch the Terminal from /Applications/Utitilities/ and let&#8217;s get started.</p>
<h2 style="font-size:1.2em;">Compare Latest Time Machine Backup to Macs Current State File by File</h2>
<p>The simplest command compares the most recent Time Machine snapshop with what is currently on the Mac:</p>
<p><code>tmutil compare</code></p>
<p>The output can be fairly lengthy depending on how long you go between backups and how much data has changed. This is basically using &#8216;diff&#8217; on the backup and current state, giving you a file by file breakdown of the differences. Files and paths with a + (plus) in front of them indicate it is new, files with a &#8211; (minus) in front indicate it has been removed, and a ! (bang) indicates the file has changed.</p>
<p><img src="http://osxdaily.com/wp-content/uploads/2012/01/tmutil-compare.gif" alt="tmutil compare output" title="tmutil-compare" width="608" height="115" class="aligncenter size-full wp-image-26271" /></p>
<p>You&#8217;ll also see the size each individual difference, and at the end of the commands output you&#8217;ll find a summary of total sizes of what has been added, removed, and changed.</p>
<p>If you only want to compare file sizes, use:</p>
<p><code>tmutil compare -s</code></p>
<h2 style="font-size:1.2em;">Compare Past Time Machine Backup to Current System State</h2>
<p>Finally, if you&#8217;re wondering how an older backup compares to the current system state, you can specify the path to the old backup:</p>
<p><code style="font-size:90%;">tmutil compare /Volumes/TimeMachineDriveName/Backups.backupdb/Macintosh\ HD/2011-11-02-129198</code></p>
<p>Replace &#8220;TimeMachineDriveName&#8221; with the name of your backup drive, replace &#8220;Macintosh HD&#8221; with the name of the primary drive, and replace the date on the end with which date you want to compare that is stored within the Time Machine backups directory.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/21/compare-time-machine-backups-tmutil/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Monitor Disk Activity in Mac OS X</title>
		<link>http://osxdaily.com/2012/01/20/monitor-disk-activity-in-mac-os-x/</link>
		<comments>http://osxdaily.com/2012/01/20/monitor-disk-activity-in-mac-os-x/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 12:27:30 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[activity monitor]]></category>
		<category><![CDATA[Disk Activity]]></category>
		<category><![CDATA[fs_usage]]></category>
		<category><![CDATA[iotop]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=26191</guid>
		<description><![CDATA[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. Watching Disk Activity with Activity Monitor Launch Activity Monitor, located in /Applications/Utilities/, or you can hit [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/monitor-disk-activity-mac.jpg" alt="Monitor Disk Activity in Mac OS X" title="monitor-disk-activity-mac" width="553" height="162" class="aligncenter size-full wp-image-26192" /></p>
<p>You can monitor disk activity in Mac OS X by using the <a href="http://osxdaily.com/2010/08/15/mac-task-manager/">Activity Monitor</a> 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. </p>
<h2 style="font-size:1.2em;">Watching Disk Activity with Activity Monitor</h2>
<ul>
<li>Launch Activity Monitor, located in /Applications/Utilities/, or you can hit Command+Space Bar to bring up Spotlight search and find it that way</li>
<li>Click on the Disk Activity tab near the bottom</li>
<li>The graph on the right plots Disk Activity</li>
<li>Pay special attention to &#8220;Data read/sec&#8221; and &#8220;Data written/sec&#8221;</li>
</ul>
<p>What&#8217;s causing the disk usage? Sometimes it correlates with CPU usage, and some apps and processes are heavy on both, like when converting video, audio, or Spotlights <a href="http://osxdaily.com/2010/08/05/mds-mac/">mds</a> and <a href="http://osxdaily.com/2009/09/14/mdworker-what-is-mdworker/">mdworker</a>. To know for sure, launch the Terminal from /Applications/Utilities/ and read on.</p>
<h2 style="font-size:1.2em;">Monitoring Disk Activity from the Command Line</h2>
<p>What is shown in Activity Monitor can be somewhat limited, and if you want information specific to what application or process is causing disk input and output, you can launch the Terminal and use the following commands to get more information:</p>
<p><code>sudo iotop -C 5 10</code></p>
<p>iotop will report back  something like this, showing the overall disk read/write, as well as processes, command (or app) and the byte size being written actively by each process:<br />
<img src="http://osxdaily.com/wp-content/uploads/2012/01/iotop.jpg" alt="iotop output" title="iotop" width="594" height="142" class="aligncenter size-full wp-image-26193" /></p>
<p>To easier compare apps and processes that are using the disk, pass the -P flag along with the iotop command, then pay attention to the % I/O column:</p>
<p><code>sudo iotop -P -C 5 10</code></p>
<p>iotop can also be narrowed down by disk drive by pointing at the path and using the -m flag. In the example below, the root filesystem only will be watched for activity:</p>
<p><code>sudo iotop -Pm /</code></p>
<p>The fs_usage app is another choice, although it&#8217;s a bit of a firehose:</p>
<p><code>sudo fs_usage -f filesys</code></p>
<p><img src="http://osxdaily.com/wp-content/uploads/2012/01/fs_usage.jpg" alt="fs_usage output" title="fs_usage" width="620" height="217" class="aligncenter size-full wp-image-26195" /></p>
<p>fs_usage also shows disk reads and writes and the application or process causing them. </p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/20/monitor-disk-activity-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discover What Apps or Processes are Interacting with a File in Mac OS X</title>
		<link>http://osxdaily.com/2012/01/13/discover-what-apps-or-processes-are-interacting-with-a-file-in-mac-os-x/</link>
		<comments>http://osxdaily.com/2012/01/13/discover-what-apps-or-processes-are-interacting-with-a-file-in-mac-os-x/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 18:28:12 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[lsof]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=25950</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/watch-what-apps-are-using-a-file.jpg" alt="Watch what apps are using a file with lsof or opensnoop" title="watch-what-apps-are-using-a-file" width="566" height="151" class="aligncenter size-full wp-image-25955" /></p>
<p>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 <a href="http://osxdaily.com/2011/04/22/monitor-mac-os-x-filesystem-usage-access-with-opensnoop/">opensnoop command</a>, 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 troubleshooting purposes.</p>
<p><code>lsof /path/to/filename</code></p>
<p>For an example, to see what is interacting with with /var/log/system.log we point it at that file:</p>
<p><code>$ lsof /var/log/system.log<br />
COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME<br />
Console 84281 Will    8r   REG   14,2   140239 71929128 /private/var/log/system.log</code></p>
<p>In this case the app using system.log is &#8220;Console&#8221;. Again, this is showing us a snapshot at the moment the lsof command was executed, but by using the previously mentioned opensnoop command instead you can follow what processes use that file in real time:</p>
<p><code>sudo opensnoop -f /var/log/system.log</code></p>
<p>The above would result in seeing something like this:<br />
<code>$ sudo opensnoop -f /var/log/system.log<br />
Password:<br />
  UID    PID COMM          FD PATH<br />
  501  84358 cat            3 /var/log/system.log<br />
  501  45411 console     3 /var/log/system.log<br />
     0  15 syslogd        16 /var/log/system.log</code></p>
<p>In this case you are looking under &#8220;COMM&#8221; for the process names, or PID for the process id.</p>
<p>Remember that you can go the opposite way with opensnoop as well, and <a href="http://osxdaily.com/2010/01/27/track-an-applications-usage-in-mac-os-x/">show all files an app is using</a> by pointing the command at an application or process, rather than a file.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/13/discover-what-apps-or-processes-are-interacting-with-a-file-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Manually Install Kernel Extensions in Mac OS X</title>
		<link>http://osxdaily.com/2012/01/12/how-to-manually-install-kernel-extensions-in-mac-os-x/</link>
		<comments>http://osxdaily.com/2012/01/12/how-to-manually-install-kernel-extensions-in-mac-os-x/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 19:14:53 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Kernel Extension]]></category>
		<category><![CDATA[kext]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=25914</guid>
		<description><![CDATA[Can&#8217;t use the easy Kext Drop app for some reason to install a kernel extension? Installing kexts (kernel extensions) manually is always an option and it&#8217;s not too difficult if you&#8217;re comfortable with the command line: Copy the .kext file(s) to /System/Library/Extensions/ Open the Terminal and type: cd /System/Library/Extensions/ Type the following commands at the [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/kext-files.jpg" alt="Kext files" title="kext-files" width="620" height="354" class="aligncenter size-full wp-image-25915" /></p>
<p>Can&#8217;t use the <a href="http://osxdaily.com/2012/01/04/install-kext-files-easily-with-kext-drop/">easy Kext Drop</a> app for some reason to install a kernel extension? Installing kexts (kernel extensions) manually is always an option and it&#8217;s not too difficult if you&#8217;re comfortable with the command line:</p>
<ul>
<li>Copy the .kext file(s) to /System/Library/Extensions/</li>
<li>Open the Terminal and type:
<li>
<code>cd /System/Library/Extensions/</code></p>
<li>Type the following commands at the terminal, replacing the kext name with the one you are installing</li>
<p><code>sudo chmod -R 755 kextfile.kext<br />
sudo chown -R root:wheel kextfile.kext</code></p>
<li>Now remove the kext caches:</li>
<p><code>sudo rm -R Extensions.kextcache<br />
sudo rm -R Extensions.mkext</code></p>
<li>Reboot the Mac</li>
</ul>
<p>The kernel extension should now be installed. </p>
<p>As you can see this is more time consuming than the <a href="http://osxdaily.com/2012/01/04/install-kext-files-easily-with-kext-drop/">alternative</a>, so ideally you&#8217;ll just one of the installer applications instead.</p>
<p><em>Thanks to Nick for <a href="http://osxdaily.com/2012/01/04/install-kext-files-easily-with-kext-drop/#comment-309915">the tip</a></em></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/12/how-to-manually-install-kernel-extensions-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Password Protect Zip Files in Mac OS X</title>
		<link>http://osxdaily.com/2012/01/07/set-zip-password-mac-os-x/</link>
		<comments>http://osxdaily.com/2012/01/07/set-zip-password-mac-os-x/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 21:10:56 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[encrypt]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[password protect zip]]></category>
		<category><![CDATA[password protection]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[unzip]]></category>
		<category><![CDATA[zip]]></category>
		<category><![CDATA[zip password]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=25711</guid>
		<description><![CDATA[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. If you&#8217;re familiar with the command line, the syntax of the encrypted zip command is as follows: zip -e [archive] [file] If you&#8217;re not [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/zip-password.jpg" alt="Zip Password in Mac OS X" title="zip-password" width="620" height="234" class="aligncenter size-full wp-image-25713" /></p>
<p>Creating a password protected zip file is easy in <a href="http://osxdaily.com/category/mac-os-x/">Mac OS X</a> and does not require any add-ons or downloads. Instead, use the zip utility that is bundled with all Macs.</p>
<p>If you&#8217;re familiar with the <a href="http://osxdaily.com/category/command-line/">command line</a>, the syntax of the encrypted zip command is as follows:<br />
<code>zip -e [archive] [file]</code></p>
<p>If you&#8217;re not sure how to use that, read on to learn how to create zip archives encrypted with passwords. These encrypted zip files will maintain password protection across platforms, meaning you can send a protected zip file to a Windows user and they will still need to enter the password in order to view the contents.</p>
<h2 style="font-size:1.3em;">Set a Zip Password in Mac OS X</h2>
<p>You can create password protected archives of files and folders:</p>
<ol>
<li>Launch the Terminal from the Applications > Utilities folder</li>
<li>Type the following command:</li>
<p><code>zip -e archivename.zip filetoprotect.txt</code></p>
<li>Enter and verify the password &#8211; don&#8217;t forget this</li>
</ol>
<p>The resulting archive, in this case named &#8220;archivename.zip&#8221;, is now encrypted with the password provided. The file that was encrypted, &#8220;filetoprotect.txt&#8221;, is now inaccessible without entering that password. </p>
<p><strong>Example: Zipping a Folder and Setting a Password</strong><br />
Here is an example of what this will look like from the command line, in this case we are compressing and password protecting the entire &#8216;Confidential&#8217; folder located within the users /Documents directory, and the password protected zip is being placed on the users desktop for easy access:<br />
<code>$ zip -e ~/Desktop/encrypted.zip ~/Documents/Confidential/<br />
Enter password:<br />
Verify password:<br />
  adding: ~/Documents/Confidential/ (deflated 13%)</code></p>
<p>Notice the password will not display, this is normal behavior for the Terminal.</p>
<h2 style="font-size:1.2em;">Opening the Password Protected Zip</h2>
<p>Despite being created at the command line, you do not need to unzip the file from the terminal, it can be expanded from the Mac OS X Finder or within Windows using standard unzipping apps. Just double click on the file, enter the password, and it will decompress. You can also decompress the zip archive from the command line with:<br />
<code>unzip filename.zip</code></p>
<p>Here are some use cases for password protected zip archives: </p>
<ul>
<li>Password protecting an individual file or directory</li>
<li>Sending a sensitive and encrypted file over an unencrypted network</li>
<li>Emailing confidential data to a Windows user</li>
<li>Adding an additional layer of security to a <a href="http://osxdaily.com/2012/01/06/hide-folders-mac/">hidden folder</a></li>
<li>Password protecting your own backups, outside of Time Machine</li>
</ul>
<p>While this can provide some protection on a per-file or folder basis, it&#8217;s always a good idea to <a href="http://osxdaily.com/2011/01/21/password-protect-mac/">password protect the Mac in general</a> with a login requirement on system boot, wake from sleep, and waking from the screen saver.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/07/set-zip-password-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Hide Folders in Mac OS X</title>
		<link>http://osxdaily.com/2012/01/06/hide-folders-mac/</link>
		<comments>http://osxdaily.com/2012/01/06/hide-folders-mac/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 20:15:38 +0000</pubDate>
		<dc:creator>Paul Horowitz</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[chflags]]></category>
		<category><![CDATA[Customize]]></category>
		<category><![CDATA[finder]]></category>
		<category><![CDATA[hidden folder]]></category>
		<category><![CDATA[hide folders]]></category>
		<category><![CDATA[hide icons]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mac OS X 10.7]]></category>
		<category><![CDATA[secret folder]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=25680</guid>
		<description><![CDATA[Need to hide a folder or two on a Mac? A while back we showed you how to make invisible folders and to even how to make hidden folders in Mac OS X, but now we&#8217;re going to demonstrate how to turn an existing folder into a hidden folder. How to Hide Folders in Mac [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/hide-folders-mac-os-x.jpg" alt="Hide Folders in Mac OS X" title="hide-folders-mac-os-x" width="620" height="253" class="aligncenter size-full wp-image-25681" /></p>
<p>Need to hide a folder or two on a Mac? A while back we showed you how to <a href="http://osxdaily.com/2011/09/30/make-an-invisible-folder-hide-in-plain-sight/">make invisible folders</a> and to even how to <a href="http://osxdaily.com/2010/05/10/create-a-hidden-folder-in-mac-os-x/">make hidden folders in Mac OS X</a>, but now we&#8217;re going to demonstrate <strong>how to turn an existing folder into a hidden folder</strong>.<br />
<span id="more-25680"></span></p>
<h2 style="font-size:1.2em;">How to Hide Folders in Mac OS X</h2>
<p>Hiding existing folders is fairly easy:</p>
<ul>
<li>Launch the Terminal, found in /Applications/Utilities/ or from Launchpad</li>
<li>Type the following command:</li>
<p><code>chflags hidden /path/to/folder/</code></p>
<li>When finished, close out of Terminal</li>
</ul>
<p>For example, to hide a folder in my home directory named &#8220;Secrets&#8221; the command would be:<br />
<code>chflags hidden ~/Secrets/</code></p>
<p>The folder will immediately disappear from visibility, becoming hidden from the Finder. This includes everything contained within the folder as well, whether they are more files or other folders.</p>
<p>If you want to truly hide the folder and it&#8217;s contents, take an extra step and <a href="http://osxdaily.com/2011/12/30/exclude-drives-or-folders-from-spotlight-index-mac-os-x/">exclude the folder from Spotlight</a> indexing. This makes sure that none of the files inside of it can be found through the Spotlight search feature in OS X.</p>
<p>While this hides folders from being visible in the GUI and will keep 95% of users unaware of the folders existence, keep in mind that practically anything is visible from the command line, and if an advanced user was keen or determined enough, they could probably track down the folder or its contents.</p>
<h2 style="font-size:1.2em;">Access the Hidden Folders in Mac OS X</h2>
<p>Now that the folder is hidden, here is how to access it:</p>
<ul>
<li>From the Mac OS X desktop, hit <strong>Command+Shift+G</strong> to bring up the &#8220;Go To Folder&#8221; window</li>
<li>Enter the same path to the folder as you used when hiding it:</li>
</ul>
<p><img src="http://osxdaily.com/wp-content/uploads/2012/01/access-hidden-folders-mac.jpg" alt="Access Hidden Folders in Mac OS X" title="access-hidden-folders-mac" width="620" height="319" class="aligncenter size-full wp-image-25682" /></p>
<p>You&#8217;ll now be inside the hidden folder, able to open, copy, move, and use the contained files and folders as usual.</p>
<h2 style="font-size:1.2em;">Unhiding the Folder in Mac OS X</h2>
<p>If you no longer want the folder to be hidden anymore, here&#8217;s what to do:</p>
<ul>
<li>As before, launch the Terminal application</li>
<li>Enter the following command:</li>
<p><code>chflags nohidden /path/to/folder/</code></p>
<li>Close the Terminal</li>
</ul>
<p>As an example, to unhide a folder on the users desktop named &#8220;Secret Folder&#8221; the command would be:<br />
<code>chflags nohidden ~/Desktop/Secret Folder/</code></p>
<p>Again, the folder will become immediately visible to the desktop. If you blocked the contents from Spotlight, you may want to remove it from there as well to be able to find and locate as usual.</p>
<p>If you read OSXDaily with any regularity, some of this will be familiar to you for good reason. The chflags nohidden command is the same thing we use to <a href="http://osxdaily.com/2011/07/04/show-library-directory-in-mac-os-x-lion/">show the Library</a> directory in OS X Lion, and accessing the folder once it is hidden is done the same way we <a href="http://osxdaily.com/2011/07/22/access-user-library-folder-in-os-x-lion/">access the user Library folder</a> when it&#8217;s hidden as well. </p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/06/hide-folders-mac/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Open New man Page Windows from an Existing Terminal in OS X Lion</title>
		<link>http://osxdaily.com/2012/01/02/open-new-man-page-from-terminal-os-x-lion/</link>
		<comments>http://osxdaily.com/2012/01/02/open-new-man-page-from-terminal-os-x-lion/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 21:44:49 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Mac OS X 10.7]]></category>
		<category><![CDATA[man]]></category>
		<category><![CDATA[man page]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=25513</guid>
		<description><![CDATA[Mac OS X Lion&#8217;s Terminal includes a new feature that lets you quickly access new manual pages from any existing Terminal window. Right-click on a command or process name and select &#8220;Open man Page&#8221; from the contextual menu, this will create a new terminal window with the manual page of that command, outfitted in the [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/open-man-page-terminal.jpg" alt="open a man page from the Terminal in OS X " title="open-man-page-terminal" width="620" height="226" class="aligncenter size-full wp-image-25514" /></p>
<p>Mac OS X Lion&#8217;s <a href="http://osxdaily.com/category/command-line/">Terminal</a> includes a new feature that lets you quickly access new manual pages from any existing Terminal window. <strong>Right-click on a command or process name and select &#8220;Open man Page&#8221;</strong> from the contextual menu, this will create a new terminal window with the manual page of that command, outfitted in the lovely yellow man page theme. </p>
<p>Because this is built into Terminal.app, the contextual menu exists when using a localhost terminal or when connected to remote servers, regardless of the host operating system. Because Mac OS X shares much of it&#8217;s underlying architecture with other flavors of UNIX, OS X will usually be able to find and launch relevant man pages even when connecting to another operating system.  </p>
<p><img src="http://osxdaily.com/wp-content/uploads/2012/01/open-man-page-from-terminal.jpg" alt="Open a man page from the Terminal in OS X Lion" title="open-man-page-from-terminal" width="620" height="279" class="aligncenter size-full wp-image-25515" /></p>
<p>Remember that man pages can also be read on the go by <a href="http://osxdaily.com/2010/09/27/open-any-man-page-in-preview-and-save-as-pdf/">saving them as a PDF</a> and opening them with iBooks app on the iPad or iPhone.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/01/02/open-new-man-page-from-terminal-os-x-lion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Open a New Terminal From the Current Finder Directory With Go2Shell</title>
		<link>http://osxdaily.com/2011/12/21/open-a-new-terminal-from-the-current-finder-directory-with-go2shell/</link>
		<comments>http://osxdaily.com/2011/12/21/open-a-new-terminal-from-the-current-finder-directory-with-go2shell/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 13:56:34 +0000</pubDate>
		<dc:creator>AJ</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Go2Shell]]></category>
		<category><![CDATA[iTerm2]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[mac apps]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=25142</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2011/12/go2shell-opens-terminal-from-finder.jpg" alt="Go2Shell opens new terminal from a Finder window" title="go2shell-opens-terminal-from-finder" width="620" height="243" class="aligncenter size-full wp-image-25152" /></p>
<p>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 <a href="http://osxdaily.com/2011/12/07/open-a-selected-finder-folder-in-a-new-terminal-window/">added to the right-click contextual menu</a>, but Go2Shell is faster due to resting in the Finder toolbar and being accessible with a single click. </p>
<ul>
<li><a href="http://itunes.apple.com/us/app/go2shell/id445770608">Download Go2Shell free on the Mac App Store</a></li>
</ul>
<p>Installation is easy, download Go2Shell from the Mac App Store and then drag Go2Shell into any Finder window toolbar. The app works with OS X Lion and Snow Leopard, although the icon needs updating to fit Lion&#8217;s UI. Removing Go2Shell from the toolbar is achieved by holding down the command key and dragging it out. </p>
<p>If you favor iTerm2 or another terminal application other than the  OS X default Terminal.app, you can select that as the default by accessing the Go2Shell configuration window. Just type the following at the command line: </p>
<p><code>open -a Go2Shell --args config</code></p>
<p>Here you&#8217;ll be able to change the terminal application and adjust the command/message that appears anytime Go2Shell is used (default is cd %PATH%; clear; pwd). </p>
<p><img src="http://osxdaily.com/wp-content/uploads/2011/12/go2shell.jpg" alt="Go2Shell" title="go2shell" width="620" height="297" class="aligncenter size-full wp-image-25143" /></p>
<p>This was <a href="http://osxdaily.com/2011/12/07/open-a-selected-finder-folder-in-a-new-terminal-window/#comment-296115">recommended in our comments</a> instead of the Services option. Outside of being quicker, the other added benefit is Mac OS X 10.6 support, which is lacking with the services menu addition. Snow Leopard users can also follow the <a href="http://osxdaily.com/2011/03/02/drag-drop-finder-items-into-the-terminal-for-their-full-path/">drag and drop to print the path</a> approach.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2011/12/21/open-a-new-terminal-from-the-current-finder-directory-with-go2shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mount a DMG from the Command Line in Mac OS X</title>
		<link>http://osxdaily.com/2011/12/17/mount-a-dmg-from-the-command-line-in-mac-os-x/</link>
		<comments>http://osxdaily.com/2011/12/17/mount-a-dmg-from-the-command-line-in-mac-os-x/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 15:34:46 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[disk image]]></category>
		<category><![CDATA[dmg]]></category>
		<category><![CDATA[hdituil]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=25019</guid>
		<description><![CDATA[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. Mounting a Disk Image File (DMG) [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2011/12/mount-dmg-command-line.jpg" alt="Mount a DMG from the Command Line in Mac OS X" title="mount-dmg-command-line" width="620" height="166" class="aligncenter size-full wp-image-25020" /></p>
<p>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. </p>
<h2 style="font-size:1.2em;">Mounting a Disk Image File (DMG) from the Terminal</h2>
<p>From the command line use the following syntax to mount the image:</p>
<p><code>hdiutil attach /path/to/diskimage.dmg</code></p>
<p>When the .dmg is mounted, a message will display something like this:</p>
<p><code>/dev/disk1          	Apple_partition_scheme<br />
/dev/disk1s1        	Apple_partition_map<br />
/dev/disk1s2        	Apple_HFS   	/Volumes/Mounted Disk Image<br />
</code></p>
<p>Take note of the last entry with the name of the just mounted disk image, you will use the first part of this line to unmount the disk (/dev/disk1s2).</p>
<h2 style="font-size:1.2em;">Unmounting a DMG from the Terminal</h2>
<p>Recalling that the device name of the mounted image, use the following syntax to unmount the dmg:</p>
<p><code>hdiutil detach /dev/disk1s2 </code></p>
<p>If you missed the device location earlier, you can retrieve information on all mounted drives and images by using:</p>
<p><code>hdiutil info</code></p>
<p>Locate the name of the mounted image and note the /dev/disk entry alongside of it.</p>
<p>The hdiutil tool <a href="http://osxdaily.com/2008/04/22/easily-mount-an-iso-in-mac-os-x/">works to mount .iso</a> and other image files as well as being able to <a href="http://osxdaily.com/2009/09/09/convert-a-dmg-to-iso-and-convert-iso-to-dmg-on-mac/">convert them</a> to other disk image formats. </p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2011/12/17/mount-a-dmg-from-the-command-line-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>


<!-- W3 Total Cache: Page cache debug info:
Engine:             disk (enhanced)
Key:                category/command-line/feed/_index.html
Caching:            disabled
Reject reason:      user agent is rejected
Status:             not cached
Creation Time:      0.787s
Header info:
X-Pingback:         http://osxdaily.com/xmlrpc.php
Last-Modified:      Sat, 11 Feb 2012 20:32:15 GMT
ETag:               "3b7d002d28756264bddb1abb87ce6be5"
X-Powered-By:       W3 Total Cache/0.9.1.3
Content-Type:       text/xml; charset=UTF-8
-->
