<?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>Fri, 25 May 2012 22:17:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to Set Up a Password-less SSH Login</title>
		<link>http://osxdaily.com/2012/05/25/how-to-set-up-a-password-less-ssh-login/</link>
		<comments>http://osxdaily.com/2012/05/25/how-to-set-up-a-password-less-ssh-login/#comments</comments>
		<pubDate>Fri, 25 May 2012 18:51:08 +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[linux]]></category>
		<category><![CDATA[Remote Login]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=30472</guid>
		<description><![CDATA[Setting up passwordless SSH logins is a great way to speed up connections to regularly accessed remote Macs and unix boxes. Because OS X doesn&#8217;t include the ssh-copy-id command, you will have to use cat or scp to copy over your ssh key. This is how to set everything up, it only takes a minute [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/05/set-up-ssh-password-less-login1.jpg" alt="Set up password-less SSH logins" title="set-up-ssh-password-less-login" width="620" height="257" class="aligncenter size-full wp-image-30480" /></p>
<p>Setting up passwordless SSH logins is a great way to speed up connections to regularly accessed <a href="http://osxdaily.com/2011/09/30/remote-login-ssh-server-mac-os-x/">remote Macs</a> and unix boxes. Because OS X doesn&#8217;t include the ssh-copy-id command, you will have to use cat or scp to copy over your ssh key. This is how to set everything up, it only takes a minute or so.</p>
<p>First, on the local machine you will want to generate a secure SSH key:</p>
<p><code>ssh-keygen</code></p>
<p>Walk through the key generator and set a password, the key file by default goes into ~/.ssh/id_rsa </p>
<p>Next, you need to copy the generated key to the remote server you want to setup passwordless logins with, this is easily done with the following command string but you can use scp if you&#8217;d prefer:</p>
<p><code>cat ~/.ssh/id_dsa.pub | ssh user@remotehost 'cat >> ~/.ssh/authorized_keys'</code></p>
<p>This command takes the generated SSH key from the local machine, connects to the remote host via SSH, and then uses cat to append the key file to the remote users authorized key list. Because this connects with SSH to the remote machine you will need to enter the password to use this command.</p>
<p>Finally, confirm that you can now login to the remote SSH server without a password:</p>
<p><code>ssh user@remotehost.com</code></p>
<p>Assuming initial setup went as intended, you will connect to the remote machine without having to log in. You can shorten the connection steps even further by <a href="http://osxdaily.com/2011/04/11/use-aliases-to-create-ssh-shortcuts/">creating an alias in bash_profile</a> so that you are only required to type a short command to immediately connect to the specified remote server.</p>
<p>There are some obvious potential security risks with using ssh without a password, the best way to mitigate that is to lock down the client machine with <a href="http://osxdaily.com/2011/01/17/lock-screen-mac/">lock screens for screen savers and sleep</a> and <a href="http://osxdaily.com/2011/01/21/password-protect-mac/">boot passwords</a>, all of which you should be utilizing anyway. </p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/05/25/how-to-set-up-a-password-less-ssh-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install wget in Mac OS X Without Homebrew or MacPorts</title>
		<link>http://osxdaily.com/2012/05/22/install-wget-mac-os-x/</link>
		<comments>http://osxdaily.com/2012/05/22/install-wget-mac-os-x/#comments</comments>
		<pubDate>Tue, 22 May 2012 19:07: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[Mac]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=30365</guid>
		<description><![CDATA[The command line tool wget lets you retrieve a group of files from FTP and HTTP protocols, it&#8217;s a very useful utility for web developers and powerusers to have around because it lets you do things like perform quick and dirty site backups and even mirror websites locally. This approach is going to build and [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/05/install-wget-mac-os-x.jpg" alt="Install wget in Mac OS X" title="install-wget-mac-os-x" width="620" height="132" class="aligncenter size-full wp-image-30368" /></p>
<p>The command line tool wget lets you retrieve a group of files from FTP and HTTP protocols, it&#8217;s a very useful utility for web developers and powerusers to have around because it lets you do things like perform <a href="http://osxdaily.com/2011/04/04/quickly-backup-a-site-through-ftp-with-wget/">quick and dirty site backups</a> and even <a href="http://osxdaily.com/2009/03/19/how-to-easily-mirror-an-entire-web-site-locally/">mirror websites locally</a>. </p>
<p>This approach is going to build and install wget in OS X from source, this means you&#8217;ll need Xcode and the Unix dev tools (<a href="http://itunes.apple.com/us/app/xcode/id497799835?mt=12">free @ Mac App Store</a>) installed, but it has the benefit of eliminating the need of a package manager like Homebrew or MacPorts. </p>
<p>Assuming you have Xcode and the command line tools installed, launch Terminal and enter the following commands:</p>
<p>First, use curl to download the latest wget source:<br />
<code>curl -O http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz</code></p>
<p>Next we use tar to uncompress the files you just downloaded:<br />
<code>tar -xzf wget-1.13.4.tar.gz</code></p>
<p>Use cd to change to the directory:<br />
<code>cd wget-1.13.4</code></p>
<p>Configure with the appropriate &#8211;with-ssl flag to prevent a &#8220;GNUTLS not available&#8221; error:<br />
<code>./configure --with-ssl=openssl</code></p>
<p>Build the source:<br />
<code>make</code></p>
<p>Install wget, it ends up in /usr/local/bin/:<br />
<code>sudo make install</code></p>
<p>Confirm everything worked by running wget:<br />
<code>wget --help</code></p>
<p>Clean up by removing wget source files when finished:<br />
<code>cd .. &#038;&#038; rm -rf wget*</code></p>
<p>You&#8217;re all set, enjoy wget in Mac OS X.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/05/22/install-wget-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Turn a Python, Perl, Ruby, or Shell Script Into a Self Contained Application for Mac OS X</title>
		<link>http://osxdaily.com/2012/05/22/turn-any-script-into-application-mac-os-x/</link>
		<comments>http://osxdaily.com/2012/05/22/turn-any-script-into-application-mac-os-x/#comments</comments>
		<pubDate>Tue, 22 May 2012 16:22:47 +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[AppleScript]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[bash script]]></category>
		<category><![CDATA[mac apps]]></category>
		<category><![CDATA[mac shell scripting]]></category>
		<category><![CDATA[Platypus]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=30354</guid>
		<description><![CDATA[Platypus is an excellent utility that lets you turn virtually any script into a self-contained Mac OS X application. Free and remarkably simple to use, Platypus will support just about any shell script, Perl, Python, PHP, Ruby, Tcl, AppleScript, Expect, and even other scripting languages. Using the app is easy, drag and drop a script [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/05/script-turned-self-contained-app.jpg" alt="Script turned into a self contained Mac OS X app" title="script-turned-self-contained-app" width="620" height="457" class="aligncenter size-full wp-image-30357" /></p>
<p>Platypus is an excellent utility that lets you turn virtually any script into a self-contained Mac OS X application. Free and remarkably simple to use, Platypus will support just about any shell script, Perl, Python, PHP, Ruby, Tcl, AppleScript, Expect, and even other scripting languages. </p>
<p>Using the app is easy, drag and drop a script onto the application, give it a name, assign an Output type (progress bar, script output, webkit view, etc), set drag &#038; drop support or not, and adjust a few other variables as necessary. When done configuring, click &#8220;Create&#8221; to build a self-contained application that holds the script inside. The resulting application is completely portable and runs independently, letting you use the app on your own Mac or elsewhere, allowing for even novice users to perform complex tasks and run scripts that would otherwise be beyond their skill level to even execute. </p>
<p>The possibilities are practically endless so let your creativity go wild, because it&#8217;s Playtpus that makes apps like the troubleshooting tool <a href="http://osxdaily.com/2012/05/21/consultants-canary-is-the-ultimate-troubleshooting-aid-for-mac-os-x/">Consultant&#8217;s Canary</a> possible.</p>
<ul>
<li><a href="http://sveinbjorn.org/platypus">Download Platypus free from Sveinbjorn</a></li>
</ul>
<p>For a basic yet practical use case, build an app to perform a necessary repetitive task and add it to a <a href="http://osxdaily.com/2006/11/29/how-to-launch-application-on-system-start-in-mac-os-x/">users Login Items</a> or put it in  the Dock or Launchpad for easy novice access. It certainly beats trying to explain to someone how to run a bash script!</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/05/22/turn-any-script-into-application-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Use Growl Notifications to Alert When Command Line Tasks Have Completed</title>
		<link>http://osxdaily.com/2012/05/17/use-growl-notifications-to-alert-when-command-line-tasks-have-completed/</link>
		<comments>http://osxdaily.com/2012/05/17/use-growl-notifications-to-alert-when-command-line-tasks-have-completed/#comments</comments>
		<pubDate>Thu, 17 May 2012 18:31:15 +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[growl]]></category>
		<category><![CDATA[growl notification]]></category>
		<category><![CDATA[Growl notifications]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=30257</guid>
		<description><![CDATA[A recent tip covered how to announce when a command line task finished by using OS X&#8217;s text-to-speech abilities. The obvious downside to that method is the sound makes it less useful to those who are using Macs in quiet environments like offices, schools, or libraries. An alternate solution is to use growlnotify to create [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/05/growlnotify-command-line.jpg" alt="Growl Notification sent from the command line with growlnotify" title="growlnotify-command-line" width="620" height="218" class="aligncenter size-full wp-image-30258" /></p>
<p>A recent tip covered how to announce when a command line task finished <a href="http://osxdaily.com/2012/05/08/announce-command-line-task-completion-mac-os-x/">by using OS X&#8217;s text-to-speech abilities</a>. The obvious downside to that method is the sound makes it less useful to those who are using Macs in quiet environments like offices, schools, or libraries. An alternate solution is to use growlnotify to create a silent notification when a command line task has finished.</p>
<p>You will need the following for this to work:</p>
<ul>
<li>Growl ($2 <a href="http://itunes.apple.com/us/app/growl/id467939042?mt=12">App Store</a>) or <a href="http://osxdaily.com/2011/12/19/growl-fork-brings-growl-notifications-to-mac-os-x-lion-for-free/">Growl Fork</a> (<a href="https://bitbucket.org/pmetzger/growl/downloads">free download</a>)</li>
<li><a href="http://growl.info/extras.php#growlnotify">growlnotify</a> installed</li>
</ul>
<p>Assuming both Growl and growlnotify have been installed, append growlnotify to the end of another command and use the -m flag to specify the notification message to use after the initial command has finished running. For example:</p>
<p><code>make install &#038;&#038; growlnotify -m "Install Completed"</code></p>
<p>The Growl message &#8220;Install Completed&#8221; will appear when make install has finished running. </p>
<p>Growl also makes it simple to send notifications to other hosts running growl, this can be done with the -H flag and by specifying an IP address. This is helpful if you&#8217;re compiling something large on a desktop Mac and want to send the completion notification to a MacBook Air while you&#8217;re working elsewhere.</p>
<p>The notification icon and other details can be modified through growlnotify command as well, use the &#8211;help flag to see all the options. </p>
<p><em>Thanks to <a href="http://osxdaily.com/2012/05/08/announce-command-line-task-completion-mac-os-x/#comment-386669">Theo</a> &#038; Jason for the tip idea</em></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/05/17/use-growl-notifications-to-alert-when-command-line-tasks-have-completed/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Make Mac OS X Speak (or Sing) the Output of Any Command Line Task</title>
		<link>http://osxdaily.com/2012/05/11/make-mac-os-x-speak-or-sing-the-output-of-any-command-line-task/</link>
		<comments>http://osxdaily.com/2012/05/11/make-mac-os-x-speak-or-sing-the-output-of-any-command-line-task/#comments</comments>
		<pubDate>Fri, 11 May 2012 18:26:45 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[say]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[text to speech]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=30080</guid>
		<description><![CDATA[Along the lines of vocally announcing task completion within the command line, you can also have Mac OS X speak the output of any executed command. This is really easy, all you need to do is pipe the output of any command directly to &#8220;say&#8221; like so: uptime &#124; say In that example, this will [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/05/speak-output-of-command.jpg" alt="Speak the output of a command line task" title="speak-output-of-command" width="620" height="211" class="aligncenter size-full wp-image-30106" /></p>
<p>Along the lines of <a href="http://osxdaily.com/2012/05/08/announce-command-line-task-completion-mac-os-x/">vocally announcing task completion</a> within the command line, you can also have Mac OS X speak the output of any executed command.</p>
<p>This is really easy, all you need to do is pipe the output of any command directly to &#8220;say&#8221; like so:</p>
<p><code>uptime | say</code></p>
<p>In that example, this will speak the output of uptime using the default OS X text-to-speech voice, though you can change the voice to anything else with the -v flag:</p>
<p><code>uname -a | say -V Samantha</code></p>
<p>Taking this a step further, it is possible to export the spoken command output to an audio file. Here&#8217;s a pointless example of saving the spoken output of the openssl manual page as an m4a file:</p>
<p><code>man openssl | say -v Samantha -o "talkopenssltome.m4a"</code></p>
<p>If you want to get ridiculous, you can use one of the <a href="http://osxdaily.com/2010/11/09/make-your-mac-sing-songs/">singing voices</a> to, well, sing the output of a command. And who doesn&#8217;t want an audio file of of the robotic Cellos voice or the awfully perky Good News singing the output of a manual page? Put it on your iPod for the drive home.</p>
<p><code>man openssl | say -v Cellos -o "serenadingmanpages.m4a"</code></p>
<p>If you don&#8217;t like the bundled voices you can always <a href="http://osxdaily.com/2011/07/25/how-to-add-new-voices-to-mac-os-x-lion/">add new voices to OS X for free through Speech</a> preference panel.</p>
<p>Get creative, because the ultimate utility of this is entirely up to you.</p>
<p><em>Thanks to <a href="http://osxdaily.com/2012/05/08/announce-command-line-task-completion-mac-os-x/#comment-386671 ">Greg P</a> for pointing this out in the comments</em></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/05/11/make-mac-os-x-speak-or-sing-the-output-of-any-command-line-task/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Announce When a Command Line Task is Completed in Mac OS X</title>
		<link>http://osxdaily.com/2012/05/08/announce-command-line-task-completion-mac-os-x/</link>
		<comments>http://osxdaily.com/2012/05/08/announce-command-line-task-completion-mac-os-x/#comments</comments>
		<pubDate>Tue, 08 May 2012 20:57: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[Mac]]></category>
		<category><![CDATA[say]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[text to speech]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=29992</guid>
		<description><![CDATA[By appending the say command to the end of another command, Mac OS X will vocally announce when the initial task has finished running successfully. For example, to have OS X announce that a particular script has finished running the command could be: python backup.py &#038;&#038; say "jobs done" The important part is the &#8220;&#038;&#038; [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/05/announce-completion-of-command-mac.jpg" alt="Announce the completion of a command in Mac OS X Terminal" title="announce-completion-of-command-mac" width="620" height="190" class="aligncenter size-full wp-image-29993" /></p>
<p>By appending the say command to the end of another command, Mac OS X will vocally announce when the initial task has finished running successfully. For example, to have OS X announce that a particular script has finished running the command could be:</p>
<p><code>python backup.py &#038;&#038; say "jobs done"</code></p>
<p>The important part is the &#8220;&#038;&#038; say&#8221; portion, which can also be customized with other voices from Mac OS X&#8217;s <a href="http://osxdaily.com/2010/03/28/how-to-make-your-mac-talk-text-to-speech/">text to speech</a> options by using the -v flag followed by a voice name, like so:</p>
<p><code>dscacheutil -flushcache &#038;&#038; say -v Alex your cache has been cleared sir</code></p>
<p>This is perfect for running scripts, making svn/git commits, compiling code, and other tasks that can take an indeterminate amount of time to complete and where it&#8217;s easy to become distracted by facebook^H^H^H^H^H^H^H^H other work.</p>
<p>This great tip was posted by <a href="https://twitter.com/niels/status/198577648660787200">@niels</a> on Twitter, follow <a href="http://twitter.com/osxdaily">@osxdaily</a> there too to get our latest posts and updates. </p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/05/08/announce-command-line-task-completion-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Empty Contents of a Specified File Without Deleting via the Command Line</title>
		<link>http://osxdaily.com/2012/05/07/empty-contents-specified-file-without-deleting/</link>
		<comments>http://osxdaily.com/2012/05/07/empty-contents-specified-file-without-deleting/#comments</comments>
		<pubDate>Mon, 07 May 2012 16:35:12 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=29937</guid>
		<description><![CDATA[If you&#8217;re working at the command line and need to quickly empty the contents of a file, throw a greater than symbol and a space in front of the filename like so: &#62; filename All content within the target file will be immediately removed without warning, leaving it blank while retaining the files existence, filename, [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/05/delete-contents-specified-file.jpg" alt="Remove Contents from a specified file without deleting the file" title="delete-contents-specified-file" width="620" height="154" class="aligncenter size-full wp-image-29940" /></p>
<p>If you&#8217;re working at the <a href="http://osxdaily.com/category/command-line/">command line</a> and need to quickly empty the contents of a file, throw a greater than symbol and a space in front of the filename like so:</p>
<p><code>&gt; filename</code></p>
<p>All content within the target file will be immediately removed without warning, leaving it blank while retaining the files existence, filename, and permissions. This is often preferable and quicker than manually deleting and recreating a file.</p>
<p>A good practical example is for clearing out the contents of log files, for example:</p>
<p><code>&gt; ~/Library/Logs/updates.log</code></p>
<p>You can also use this command to create a new 0 byte file at the location, similar to using the touch command.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/05/07/empty-contents-specified-file-without-deleting/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Generate and Set a Random Valid MAC Address from the Command Line in OS X</title>
		<link>http://osxdaily.com/2012/05/02/generate-and-set-random-valid-mac-address/</link>
		<comments>http://osxdaily.com/2012/05/02/generate-and-set-random-valid-mac-address/#comments</comments>
		<pubDate>Wed, 02 May 2012 17:20:26 +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[ifconfig]]></category>
		<category><![CDATA[mac address]]></category>
		<category><![CDATA[mac address generator]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[spoof]]></category>
		<category><![CDATA[spoof MAC address]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[wi-fi]]></category>
		<category><![CDATA[Wifi]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=29820</guid>
		<description><![CDATA[We&#8217;ve shown you how to generate MAC addresses randomly and then how to go about changing a MAC address in OS X Lion and OS X Mountain Lion, but why have those be two separate actions? Using the command line, you can combine the two events into a single action to generate a valid MAC [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/05/change-mac-address-os-x.jpg" alt="Generate and set random MAC address in OS X " title="change-mac-address-os-x" width="620" height="152" class="aligncenter size-full wp-image-29832" /></p>
<p>We&#8217;ve shown you how to <a href="http://osxdaily.com/2010/11/10/random-mac-address-generator/">generate MAC addresses randomly</a> and then how to go about <a href="http://osxdaily.com/2012/03/01/change-mac-address-os-x/">changing a MAC address in OS X</a> Lion and OS X Mountain Lion, but why have those be two separate actions? Using the command line, you can combine the two events into a single action to generate a valid MAC and then set it immediately.</p>
<p>Launch the Terminal and paste the following onto a single line:</p>
<p><code>openssl rand -hex 1 | tr '[:lower:]' '[:upper:]' | xargs echo "obase=2;ibase=16;" | bc | cut -c1-6 | sed 's/$/00/' | xargs echo "obase=16;ibase=2;" | bc | sed "s/$/:$(openssl rand -hex 5 | sed 's/\(..\)/\1:/g; s/.$//' | tr '[:lower:]' '[:upper:]')/" | xargs sudo ifconfig en0 ether</code></p>
<p>There is no confirmation or output, the MAC address is set immediately which you can verify with the following command:</p>
<p><code>ifconfig en0 |grep ether</code></p>
<p>You will probably need to reconnect to the wireless router after issuing the command, and in some cases turn wi-fi on and off again.</p>
<p>If you intend on using this often, setting up an alias in .bash_profile would be a good idea to avoid having to cut and paste the massive block of text.</p>
<p><em>Thanks to <a href="http://osxdaily.com/2012/03/01/change-mac-address-os-x/#comment-384258">osmium</a> for the great tip</em></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/05/02/generate-and-set-random-valid-mac-address/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Open Terminal Faster by Specifying a Shell</title>
		<link>http://osxdaily.com/2012/04/30/open-terminal-faster-by-specifying-a-shell/</link>
		<comments>http://osxdaily.com/2012/04/30/open-terminal-faster-by-specifying-a-shell/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 16:17:09 +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]]></category>
		<category><![CDATA[mac shell]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=29764</guid>
		<description><![CDATA[Whenever a new Terminal window is launched, a variety of system logs are read to provide information on the last login. One way to speed up launching a new terminal window is to delete those .asl log files, but you can achieve a substantial speed boost by simply setting Terminal to open a shell rather [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/04/open-terminal-faster.jpg" alt="Open Terminal faster by specifying a login shell" title="open-terminal-faster" width="620" height="138" class="aligncenter size-full wp-image-29767" /></p>
<p>Whenever a new Terminal window is launched, a variety of system logs are read to provide information on the last login. One way to speed up launching a new terminal window is to <a href="http://osxdaily.com/2010/05/06/speed-up-a-slow-terminal-by-clearing-log-files/">delete those .asl log files</a>, but you can achieve a substantial speed boost by simply setting Terminal to open a shell rather than /usr/bin/login. This is achieved through the same means of <a href="http://osxdaily.com/2012/03/21/change-shell-mac-os-x/">changing the shell</a> and is just a few quick steps within Terminal settings:</p>
<ol>
<li>Open Preferences from within the Terminal pulldown menu</li>
<li>Click the &#8220;Startup&#8221; tab</li>
<li>Look for &#8220;Shells open with:&#8221; and check the box next to &#8220;Command (complete path):&#8221;</li>
</ol>
<p>The default shell is /bin/bash but you&#8217;re free to choose another.</p>
<p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/04/specify-shell-terminal.jpg" alt="Specify a shell within Terminal to speed up opening new Terminal windows" title="specify-shell-terminal" width="620" height="542" class="aligncenter size-full wp-image-29766" /></p>
<p>Once this setting has been adjusted, launch a new Terminal window and you should immediately notice the difference. This works because the many .asl log files are bypassed, but as a side effect you will lose the &#8220;<a href="http://osxdaily.com/2010/06/22/remove-the-last-login-message-from-the-terminal/">Last login</a>&#8221; MOTD message at login unless specified otherwise.</p>
<p><em>Thanks for the tip <a href="http://osxdaily.com/2010/05/06/speed-up-a-slow-terminal-by-clearing-log-files/#comment-354197">Darren</a> &#038; Yorkster</em></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/04/30/open-terminal-faster-by-specifying-a-shell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Get Extended CPU Information from the Command Line</title>
		<link>http://osxdaily.com/2012/04/28/get-extended-cpu-information-from-the-command-line/</link>
		<comments>http://osxdaily.com/2012/04/28/get-extended-cpu-information-from-the-command-line/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 20:21: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>

		<guid isPermaLink="false">http://osxdaily.com/?p=29747</guid>
		<description><![CDATA[Using sysctl we can get extended information on a Macs processor, covering everything from CPU brand and identifier, clock speed, number of cores, thread count, thermal sensor data, cache size, and some significantly more technical information. Launch the Terminal and enter the following command: sysctl -a &#124; grep machdep.cpu A limited sample of the output [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/04/get-mac-cpu-info-command-line.jpg" alt="Get extended CPU information from the command line" title="get-mac-cpu-info-command-line" width="620" height="246" class="aligncenter size-full wp-image-29748" /></p>
<p>Using sysctl we can get extended information on a Macs processor, covering everything from CPU brand and identifier, clock speed, number of cores, thread count, thermal sensor data, cache size, and some significantly more technical information. </p>
<p>Launch the Terminal and enter the following command:</p>
<p><code>sysctl -a | grep machdep.cpu</code></p>
<p>A limited sample of the output looks as follows:<br />
<code>$ sysctl -a | grep machdep.cpu<br />
machdep.cpu.max_basic: 13<br />
machdep.cpu.max_ext: 2147483656<br />
machdep.cpu.vendor: GenuineIntel<br />
machdep.cpu.brand_string: Intel(R) Core(TM)2 Duo CPU     P8600  @ 2.40GHz<br />
machdep.cpu.family: 6<br />
machdep.cpu.model: 23<br />
machdep.cpu.extmodel: 1<br />
machdep.cpu.extfamily: 0<br />
machdep.cpu.stepping: 10<br />
machdep.cpu.feature_bits: 3219913727 67691517<br />
machdep.cpu.extfeature_bits: 537921536 1<br />
machdep.cpu.signature: 67194<br />
machdep.cpu.brand: 0<br />
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 CX16 TPR PDCM SSE4.1 XSAVE<br />
machdep.cpu.extfeatures: SYSCALL XD EM64T LAHF<br />
machdep.cpu.logical_per_package: 2<br />
machdep.cpu.cores_per_package: 2</code></p>
<p>The sysctl command is fairly powerful and can provide extensive technical information, we have used it before to <a href="http://osxdaily.com/2011/07/15/get-cpu-info-via-command-line-in-mac-os-x/">get basic processor information</a>, see if a Mac <a href="http://osxdaily.com/2009/09/23/check-if-your-mac-is-64-bit-compatible-via-command-line/">is 64 bit compatible</a>, discover the <a href="http://osxdaily.com/2011/07/14/get-exact-boot-sleep-and-wake-times-from-the-command-line/">precise boot, sleep, and wake times</a> of a Mac, find CPU <a href="http://osxdaily.com/2010/10/23/how-to-check-the-mac-processor-speed/">clock speed</a>, and to get assorted other tidbits about Macs hardware.</p>
<p><em>Thanks for the tip <a href="http://osxdaily.com/2007/04/23/get-system-information-from-the-command-line/#comment-5575">nicentral</a></em></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/04/28/get-extended-cpu-information-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Free Up Inactive Memory in Mac OS X with Purge Command</title>
		<link>http://osxdaily.com/2012/04/24/free-up-inactive-memory-in-mac-os-x-with-purge-command/</link>
		<comments>http://osxdaily.com/2012/04/24/free-up-inactive-memory-in-mac-os-x-with-purge-command/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 14:42: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[Mac]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[purge]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=29634</guid>
		<description><![CDATA[Mac OS X has fairly good memory management but it&#8217;s not perfect, and sometimes RAM can be held unnecessarily in the &#8220;inactive&#8221; state despite the contents no longer being needed. If you&#8217;ve been participating in memory heavy activities or you just need to free up some available RAM you can actually force Mac OS X [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/04/free-up-memory-mac.jpg" alt="Free Up Memory in Mac OS X" title="free-up-memory-mac" width="620" height="329" class="aligncenter size-full wp-image-29635" /></p>
<p>Mac OS X has fairly good memory management but it&#8217;s not perfect, and sometimes RAM can be held unnecessarily in the &#8220;inactive&#8221; state despite the contents no longer being needed. If you&#8217;ve been participating in memory heavy activities or you just need to free up some available RAM you can actually force Mac OS X to clear out inactive memory. </p>
<ul>
<li>Launch Terminal, found in /Applications/Utilities/ and enter the following command</li>
<p><code>purge</code></p>
<li>Give OS X a minute or two to complete the process</li>
</ul>
<p>Open <a href="http://osxdaily.com/2010/08/15/mac-task-manager/">Activity Monitor</a> to see the before and after results yourself, you&#8217;ll find dramatic changes at the &#8220;Free&#8221;, &#8220;Used&#8221;, and &#8220;Inactive&#8221; meters under System Memory. </p>
<p>The purge command forces disk and memory caches to be emptied, offering a &#8216;cold disk buffer cache&#8217; which is similar to the state of the operating system after a reboot. Of course, the benefit of using purge rather than rebooting is that you don&#8217;t have to restart the machine and you can maintain currently active applications while still freeing up memory. </p>
<p>This is not necessary for most Mac users, but power users and those with heavy memory demands will undoubtedly find this command helpful in the future. If you feel like you are frequently hitting a memory ceiling <a href="http://osxdaily.com/2010/10/29/does-your-mac-need-more-memory-how-to-know-if-you-need-a-ram-upgrade/">learn how to check if your Mac needs a RAM upgrade</a> and consider upgrading, it can dramatically improve overall system performance.</p>
<p>Note: You may need to have XCode &#038; Developer Tools installed in order to use the purge command, that can be downloaded for free <a href="http://itunes.apple.com/us/app/xcode/id497799835?mt=12">from the Mac App Store</a>.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/04/24/free-up-inactive-memory-in-mac-os-x-with-purge-command/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Change Length of Bash Command History or Disable Bash History Completely</title>
		<link>http://osxdaily.com/2012/04/12/change-length-of-bash-command-history-or-disable-bash-history-completely/</link>
		<comments>http://osxdaily.com/2012/04/12/change-length-of-bash-command-history-or-disable-bash-history-completely/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 15:54:26 +0000</pubDate>
		<dc:creator>William Pearson</dc:creator>
				<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=29331</guid>
		<description><![CDATA[A users .bash_history file keeps a running tab of command line history, logging every command that has been entered into the bash prompt. These command history files make it very easy to find and recall past commands that may have been forgotten, and they&#8217;re also extremely useful for system administration. We will cover how to [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/04/bash_history.gif" alt="Bash History" title="bash_history" width="611" height="294" class="aligncenter size-full wp-image-29335" /></p>
<p>A users .bash_history file keeps a running tab of command line history, logging every command that has been entered into the bash prompt. These command history files make it very easy to find and recall past commands that may have been forgotten, and they&#8217;re also extremely useful for system administration. We will cover how to change the stored length of these files, how to disable it, and also how to quickly check a users bash history.</p>
<h2 style="font-size:1.2em;">Changing Bash History Length</h2>
<p>To increase the history length of a users command history, add the following line to .bash_profile:</p>
<p><code>HISTFILESIZE=2500</code></p>
<p>The example above will increase the history size to 2500 commands, that can be changed to any other number as deemed appropriate. </p>
<h2 style="font-size:1.2em;">Disable Bash History</h2>
<p>Setting the HISTFILESIZE number to 0 within .bash_profile will disable bash command history completely:</p>
<p><code>HISTFILESIZE=0</code></p>
<p>Having the history file disabled does not effect command recall, but it does prevent a super user from easily seeing the commands entered into another users shell.</p>
<h2 style="font-size:1.2em;">Checking Bash History</h2>
<p>There&#8217;s a few quick ways to see command history, to see your own type:</p>
<p><code>history</code></p>
<p>You can also export that command history to a file with the -w flag:</p>
<p><code>history -w pastbash.txt</code></p>
<p>To see another users command history, use cat with their .bash_history file instead:</p>
<p><code>cat /Users/USERNAME/.bash_history</code></p>
<p>Remember that if USERNAME has set their history file size to zero, nothing will be shown.</p>
<p><strong>Practical Applications for Mac Users</strong><br />
Two of the most common applications for a Mac user is to <a href="http://osxdaily.com/2012/01/31/see-all-previously-used-defaults-commands/">keep track of defaults entries</a> that have been entered into the Terminal and to quickly find past commands. <a href="http://osxdaily.com/2011/02/06/print-and-query-command-history-to-find-past-commands/">Query command history</a> and you won&#8217;t have to guess what that obscure command was that you entered four months ago that started with a &#8216;s&#8217;.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/04/12/change-length-of-bash-command-history-or-disable-bash-history-completely/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Create a Tar GZip File from the Command Line</title>
		<link>http://osxdaily.com/2012/04/05/create-tar-gzip/</link>
		<comments>http://osxdaily.com/2012/04/05/create-tar-gzip/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 23:31:16 +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[gzip]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=29167</guid>
		<description><![CDATA[You&#8217;re probably familiar with making your own zip files if you&#8217;ve ever needed to transfer a group of files or if you&#8217;re managing your own backups outside of Time Machine. Using the GUI zip tools are easy and user friendly, but if you want some more advanced options with better compression you can turn to [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/04/create-tar-gz.jpg" alt="How to Create a Tar GZip Archive Bundle " title="create-tar-gz" width="620" height="87" class="aligncenter size-full wp-image-29170" /></p>
<p>You&#8217;re probably familiar with <a href="http://osxdaily.com/2012/01/10/how-to-zip-files-in-mac-os-x/">making your own zip files</a> if you&#8217;ve ever needed to transfer a group of files or if you&#8217;re managing your own backups outside of Time Machine. Using the GUI zip tools are easy and user friendly, but if you want some more advanced options with better compression you can turn to the command line to make a tar and gzip archive. The syntax will be the same in Mac OS X as it is in Linux.</p>
<h2 style="font-size:1.2em;">Creating a Tar GZip Archive Bundle</h2>
<p>From the command line (/Applications/Terminal/), use the following syntax:</p>
<p><code>tar -cvzf tarballname.tar.gz itemtocompress</code></p>
<p>For example, to compress a directories jpg files only, you&#8217;d type:</p>
<p><code>tar -cvzf jpegarchive.tar.gz /path/to/images/*.jpg</code></p>
<p>The * is a wildcard here, meaning anything with a .jpg extension will be compressed into the jpegarchive.tar.gz file and nothing else.</p>
<p>The resulting .tar.gz file is actually the product of two different things, tar basically just packages a group of files into a single file bundle but doesn&#8217;t offer compression on it&#8217;s own, thus to compress the tar you&#8217;ll want to add the highly effective gzip compression. You can run these as two separate commands if you really want to, but there isn&#8217;t much need because the tar command offers the -z flag which lets you automatically gzip the tar file. </p>
<h2 style="font-size:1.2em;">Opening .tar.gz Archives</h2>
<p>Unpacking the gz and tar files can be done with applications like <a href="http://osxdaily.com/2012/01/30/extract-installer-package-files-mac-os-x-pacifist/">Pacifist</a> or <a href="http://itunes.apple.com/us/app/the-unarchiver/id425424353?mt=12">Unarchiver</a> (free), or by going back to the command line with:</p>
<p><code>gunzip filename.tar.gz</code></p>
<p>Followed by:</p>
<p><code>tar -xvf filename.tar</code></p>
<p>Generally you should untar things into a directory, or the present working directory will be the destination which can get messy quick.</p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/04/05/create-tar-gzip/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Lock the Mac Desktop from the Command Line</title>
		<link>http://osxdaily.com/2012/03/30/lock-mac-desktop-command-line/</link>
		<comments>http://osxdaily.com/2012/03/30/lock-mac-desktop-command-line/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 15:03:13 +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[lock screen]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[screen lock Mac]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=28937</guid>
		<description><![CDATA[With the help of a buried menu item, we can lock the Mac OS X screen right from the Terminal. This does not log a user out, it just brings up the standard Mac OS X lock screen and login window, requiring a valid user and password before the Mac can be used again. Open [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/03/lock-screen-mac-command-line.jpg" alt="Lock the Mac OS X Screen from the Command Line" title="lock-screen-mac-command-line" width="620" height="150" class="aligncenter size-full wp-image-28960" /></p>
<p>With the help of a buried menu item, we can lock the Mac OS X screen right from the Terminal. This does not log a user out, it just brings up the standard Mac OS X <a href="http://osxdaily.com/2011/01/17/lock-screen-mac/">lock screen and login window</a>, requiring a valid user and password before the Mac can be used again. </p>
<p>Open Terminal and enter the following in a single line:</p>
<p><code style="font-size:92%;">/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend</code></p>
<p>There isn&#8217;t any confirmation, the desktop is immediately locked and the lock screen appears regardless of what is currently going on with the active user account. </p>
<p>For those wondering, the menu item being used is the same Fast User Switching menu that displays a <a href="http://osxdaily.com/2012/01/10/remove-user-name-from-menu-bar-os-x/">user name in the upper right corner</a>, and the lock screen shown is identical to what is summoned if one were to select &#8220;Login Window&#8230;&#8221; from that same menu.</p>
<p>You can lock a screen using a <a href="http://osxdaily.com/2011/01/17/lock-screen-mac/">keyboard shortcut as well</a>, but using the command line offers two obvious advantages; it can be included within scripts or entered from <a href="http://osxdaily.com/2011/09/30/remote-login-ssh-server-mac-os-x/">SSH</a> to remotely lock a Mac. </p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/03/30/lock-mac-desktop-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quickly Get a Router IP Address from the Command Line</title>
		<link>http://osxdaily.com/2012/03/23/get-router-ip-address-command-line/</link>
		<comments>http://osxdaily.com/2012/03/23/get-router-ip-address-command-line/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 21:17: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[netstat]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[wireless router]]></category>

		<guid isPermaLink="false">http://osxdaily.com/?p=28740</guid>
		<description><![CDATA[To quickly retrieve the IP address of the router you are connected through, type the following at the command line: netstat -rn &#124;grep default The result will look something like this, showing the router IP directly after &#8220;default&#8221;: default 192.168.1.1 UGSc 108 0 en0 netstat will work for both wired and wireless connections, the difference [...]]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><img src="http://cdn.osxdaily.com/wp-content/uploads/2012/03/router-ip-address.jpg" alt="Router IP Address" title="router-ip-address" width="620" height="151" class="aligncenter size-full wp-image-28741" /></p>
<p>To quickly retrieve the IP address of the router you are connected through, type the following at the command line: </p>
<p><code>netstat -rn |grep default</code></p>
<p>The result will look something like this, showing the router IP directly after &#8220;default&#8221;: </p>
<p><code>default            192.168.1.1        UGSc          108        0     en0</code></p>
<p>netstat will work for both wired and wireless connections, the difference of which will be shown as the interface. These are typically en0 and en1,  though the port interfaces will vary slightly with Macs that don&#8217;t include ethernet ports or AirPort wireless card, and for Macs with only one form of network connectivity it will almost always be en0. </p>
<p>For users who don&#8217;t want to bother with the command line, the router IP can also be <a href="http://osxdaily.com/2011/09/15/find-a-routers-ip-address-in-mac-os-x/">found from the Network system preference panel</a>. </p>
<p><em>Thanks to Hans and Jen for the <a href="http://osxdaily.com/2011/09/15/find-a-routers-ip-address-in-mac-os-x/#comment-363431">tip</a></em></p>
</div>]]></content:encoded>
			<wfw:commentRss>http://osxdaily.com/2012/03/23/get-router-ip-address-command-line/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 4/39 queries in 0.038 seconds using disk: basic
Object Caching 1211/1337 objects using disk: basic
Content Delivery Network via cdn.osxdaily.com

Served from: osxdaily.com @ 2012-05-25 16:45:22 -->
