<?xml version="1.0" encoding="iso-8859-1"?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>macosxhints.com Unix tips and tricks</title>
<link>http://hints.macworld.com/index.php?topic=unix</link>
<description>Unix tips and tricks from macosxhints.com</description>
<managingEditor>webteam@macosxhints.com</managingEditor>
<webMaster>webteam@macosxhints.com</webMaster>
<copyright>Copyright 2013 Mac OS X Hints</copyright>
<generator>Geeklog</generator>
<pubDate>Thu, 11 Apr 2013 07:30:00 -0700</pubDate>
<language>en-gb</language>
<atom:link href="http://hints.macworld.com/backend/hintsunix.rss" rel="self" type="application/rss+xml" />
<item>
<title>Find users that use the most disk space</title>
<link>http://hints.macworld.com/article.php?story=20130404072518701</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20130404072518701</guid>
<pubDate>Thu, 11 Apr 2013 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20130404072518701#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Find which users take up the most disk space. This can of course be used to indentify any number of users so I picked 10 as an arbitrary number.&lt;br&gt;&lt;br&gt;If you are already root (unlikely, but possible) you can remove the &lt;code&gt;sudo -s&lt;/code&gt; part.  Here's the command: &lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:60px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;sudo -s du -sm /Users/* | sort -nr | head -n 10&lt;/pre&gt;&lt;/div&gt;Generally you would have to make sure that you use &lt;code&gt;sudo -s&lt;/code&gt; or it will give a few Permission denied errors before finally spitting out the results, and they may be incorrect. The directory structure should start with the &lt;i&gt;/Users&lt;/i&gt; Directory and then it will recursively perform the operation. This may miss any folders outside of the normal user space, but there shouldn't normally be any user data there.&lt;br&gt;&lt;br&gt;[&lt;b&gt;crarko adds:&lt;/b&gt; I tested this, and it works as de ...</description>
</item>
<item>
<title>Flatten a directory structure </title>
<link>http://hints.macworld.com/article.php?story=20130224223337451</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20130224223337451</guid>
<pubDate>Tue, 26 Feb 2013 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20130224223337451#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>There may be times when you want to consolidate all the files in a directory and its sub-directories (or a folder and its sub-folders) into a single directory or folder. For example, you may have a folder with sub-folders for years, and other sub-folders in each year folder for months, and you may want to move files in the month folders all to the top level. &lt;br&gt;&lt;br&gt;Doing this manually is a complex and time-consuming process. While you might be able to do this by using a search - for example, if all the files are, say, Excel files, you can search for Excel files in the top folder, then just copy them all to a new folder - if there are lots of different types of files, this wouldn't make things easier.&lt;br&gt;&lt;br&gt;Fortunately, there's a way to do this from a command line. On the &lt;a href=&quot;http://www.bedroomlan.org/coding/flatten-directory-structure&quot;&gt;BedroomLAN&lt;/a&gt; blog, Alexios presents two commands that will do this:&lt;br&gt;&lt;br&gt; &lt;tt&gt;cd &amp;#36;ROOT_DIRECTORY&lt;br&gt;find -type f -print0 | xar ...&lt;/tt&gt;</description>
</item>
<item>
<title>Extract names and emails from a text file</title>
<link>http://hints.macworld.com/article.php?story=20130219161025495</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20130219161025495</guid>
<pubDate>Wed, 20 Feb 2013 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20130219161025495#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I have a recurring need to extract full names and email addresses from a plaintext archive of email messages. The archive is created by selecting a bunch of emails in Mail, copying them, pasting into TextEdit, and converting to plain text.&lt;br&gt;&lt;br&gt;For each message in the file, the first line contains the information I wanted:&lt;pre&gt;From: Joe Example &amp;lt;joe@example.com&amp;gt;&lt;/pre&gt;I wanted one email address per line, suitable for pasting into another location. I am far from an expert with the &lt;tt&gt;bash&lt;/tt&gt; shell, but here's what I came up with—I imagine there are many more efficient ways to do this, as I'm sure experienced &lt;tt&gt;perl&lt;/tt&gt;, &lt;tt&gt;sed&lt;/tt&gt;, &lt;tt&gt;awk&lt;/tt&gt;, etc. users may point out. Note that this is highly dependent on the format created by Apple's Mail app in OS X 10.8.&lt;br&gt;&lt;br&gt;&lt;tt&gt;grep 'From:' /path/to/archive.txt | cut -f2 -d&amp;#092;&amp;lt; | cut -f1 -d&amp;#092;&amp;gt; | pbcopy&lt;/tt&gt;&lt;br&gt;&lt;br&gt;The &lt;tt&gt;grep&lt;/tt&gt; bit pulls out the entire &lt;tt&gt;From:&lt;/tt&gt; line, then the first &lt;tt&gt;cut ...&lt;/tt&gt;</description>
</item>
<item>
<title>Control the Finder with the Terminal</title>
<link>http://hints.macworld.com/article.php?story=20121031111929732</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20121031111929732</guid>
<pubDate>Thu, 13 Dec 2012 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20121031111929732#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>There are several ways to open a Terminal window to the current directory in the Finder. But wouldn't it be useful if you could do the reverse and open a Finder window to the current Terminal directory? Well, you can, and you can completely control the Finder from the terminal.&lt;br&gt;&lt;br&gt; I have put the code on &lt;a href=&quot;https://github.com/NapoleonWils0n/bashfinder&quot;&gt;github&lt;/a&gt; with full instructions on how to set it up. It works by using bash_completion, .bash_profile with some applescript to control the Finder, .inputrc and .bash_aliases.&lt;br&gt;&lt;br&gt; Here are some of the features:&lt;ul&gt;	&lt;li&gt;Changing a directory in the Terminal opens the same directory in the Finder.&lt;/li&gt;	&lt;li&gt;You can change the Finder window view from the Terminal (column, list, icon views).&lt;/li&gt;	&lt;li&gt;It is case insensitve, you can press Tab for menu completion, and Shift-Tab to expand bash aliases.&lt;/li&gt;	&lt;li&gt;Open a Terminal directory to the current Finder window.&lt;/li&gt;&lt;/ul&gt;This code will work with both the Terminal ...</description>
</item>
<item>
<title>See how long a given process has been running</title>
<link>http://hints.macworld.com/article.php?story=20121127064752309</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20121127064752309</guid>
<pubDate>Wed, 28 Nov 2012 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20121127064752309#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I wanted to find out how long a certain background process had been running. There's a column for CPU Time in Activity Monitor, but that's not real clock time.&lt;br&gt;&lt;br&gt; It turns out you can get this information with &lt;tt&gt;ps&lt;/tt&gt;, via the &lt;tt&gt;etime&lt;/tt&gt; keyword. So to get a list of every running process, in decreasing order of run time, just use this command:&lt;pre&gt;ps -ax -o etime,command -c&lt;/pre&gt;To see the results for a single process, just add a &lt;tt&gt;grep&lt;/tt&gt; at the end for the process' name. For example:&lt;pre&gt;&amp;#36; ps -ax -o etime,command -c | grep AppleVNCServer03-08:09:16 AppleVNCServer&lt;/pre&gt;So on my Mac, the &lt;tt&gt;AppleVNCServer&lt;/tt&gt; has been running for three days, eight hours, nine minutes, and 16 seconds. I have a need to do this pretty regularly, so I turned it into a simple command line app:&lt;pre&gt;#!/bin/bash# Display the time a given process has been running# Use the process name when calling the commandps -ax -o etime,command -c | grep &amp;#36;1&lt;/pre&gt;I saved tha ...</description>
</item>
<item>
<title>See details of an app's virtual size</title>
<link>http://hints.macworld.com/article.php?story=20121016063646746</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20121016063646746</guid>
<pubDate>Fri, 19 Oct 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20121016063646746#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>If you use &lt;tt&gt;top&lt;/tt&gt; in Terminal, you may occasionally see apps with &lt;b&gt;huge&lt;/b&gt; &lt;tt&gt;VSIZE&lt;/tt&gt; values. I know this because Witch, one of our apps, is an example of such&amp;mdash;it's &lt;tt&gt;VSIZE&lt;/tt&gt; can exceed 11GB.&lt;br&gt;&lt;br&gt;In trying to figure out why this was so (short answer seems to be: we can't control it, but it's not a problem), I ran across an interesting command, &lt;tt&gt;vmmap&lt;/tt&gt;. This command will spew out a &lt;b&gt;ton&lt;/b&gt; of detail about virtual memory usage. Stringing a couple Unix commands together, though, you can extract just the summary portion of the report.
In Terminal, run this command:&lt;pre&gt;&lt;code&gt;vmmap -resident PID# | grep &quot;Summary for&quot; -A 999&lt;/code&gt;&lt;/pre&gt;Replace &lt;tt&gt;PID#&lt;/tt&gt; with the process ID you're interested in observing, and you'll get a nice summary of its virtual memory state. You can see what's virtual, and what's actually resident. Here's a bit of the output for Witch, for example:&lt;pre&gt;&lt;code&gt;...REGION TYPE                      VIRTUAL RESIDENT====== ...&lt;/code&gt;&lt;/pre&gt;</description>
</item>
<item>
<title>Quickly eject all disks from the command line </title>
<link>http://hints.macworld.com/article.php?story=20120901094847629</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120901094847629</guid>
<pubDate>Wed, 05 Sep 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120901094847629#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Instead of using the following to eject all disks:&lt;pre&gt;osascript -e 'tell &quot;Finder&quot; to eject (every disk)' &lt;/pre&gt;I've found that this is much faster:&lt;pre&gt;find /Volumes -maxdepth 1 -not -user root -print0 | xargs -0 diskutil eject &lt;/pre&gt;Run this command from Terminal, or in a shell script, to eject all your local disks.&lt;br&gt;&lt;br&gt; To eject network volumes, this code works:&lt;pre&gt;find /Volumes -maxdepth 1 -not -user root -print0 | xargs -0 umount &lt;/pre&gt; [&lt;b&gt;kirkmc adds&lt;/b&gt;: The problem with this hint is that each line of code works for different types of volumes. If you have both local and network volumes, you need to use both; you could, of course, stick them together with a semi-colon separating them so they are, in effect, a single command.. In my tests, it's not really faster than the &lt;tt&gt;osascript&lt;/tt&gt; code above, but I'm posting it because some may find it useful. If you have different results in speed or efficacy, please post in the comments.] 
</description>
</item>
<item>
<title>Send Terminal output to iCloud </title>
<link>http://hints.macworld.com/article.php?story=201208200006343</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=201208200006343</guid>
<pubDate>Tue, 21 Aug 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=201208200006343#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Imagine that you run a script automatically on your Mac, and that you want to check the result of that script. There are many ways you could do this, such as remotely connecting to the Mac, or sending the results by e-mail. But with iCloud, you can also save the output to a file and put it on iCloud, where you can access it with your favorite iCloud-compatible text editor on another Mac, or on an iOS device.&lt;br&gt;&lt;br&gt; To do so, simply send the output of the script to a file like this:&lt;br&gt;&lt;br&gt; &lt;tt&gt;~/Library/Mobile&amp;#092; Documents/com&amp;#092;~apple&amp;#092;~TextEdit/Documents/filename.txt&lt;/tt&gt;&lt;br&gt;&lt;br&gt; So, to save a list of a directory's contents, you'd use this:&lt;br&gt;&lt;br&gt; &lt;tt&gt;ls -al &gt; ~/Library/Mobile&amp;#092; Documents/com&amp;#092;~apple&amp;#092;~TextEdit/Documents/list.txt&lt;/tt&gt; &lt;br&gt;&lt;br&gt; That saves a file called list.txt in TextEdit's Documents folder. Look inside the ~/Library/Mobile&amp;#092; Documents folder for the paths to other apps you have that can use iCloud. Each folder in the Mobile  ...</description>
</item>
<item>
<title>Command-drag to Terminal to change directory </title>
<link>http://hints.macworld.com/article.php?story=20120726193230711</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120726193230711</guid>
<pubDate>Mon, 30 Jul 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120726193230711#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>If you hold down the Command key while dragging an icon to a Terminal window, it will &lt;tt&gt;cd&lt;/tt&gt; to either the directory you dragged (if it's a folder) or the directory containing the item you dragged (if it's a file). &lt;br&gt;&lt;br&gt; I don't know when this feature appeared; it might not be specific to 10.8, but that's where I discovered it.&lt;br&gt;&lt;br&gt; [&lt;b&gt;kirkmc adds&lt;/b&gt;: This is a really neat feature. Also, if you Command-drag an application or other bundle, Terminal will &lt;tt&gt;cd&lt;/tt&gt; to inside that bundle. This is great if you need to access files within an application bundle, for example. The comments are saying that this is indeed 10.8 only.]
</description>
</item>
<item>
<title>Script to delete huge sparsebundle images</title>
<link>http://hints.macworld.com/article.php?story=20120709152257934</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120709152257934</guid>
<pubDate>Thu, 19 Jul 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120709152257934#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I needed to restart a backup for one of my Macs, which had an 800 GB disk image on my Time Capsule. It turned out to be impossible to delete the disk image - in Finder, it would just not move to the Trash, even after waiting for several hours.&lt;br&gt;&lt;br&gt; I was looking for advice and most of the suggestions involved reformatting the Time Capsule, but I couldn't do this, as I had other Macs being backed up there.&lt;br&gt;&lt;br&gt; I looked for a way to do this from the command line. The Time Machine disk image - a sparsebundle, a special type of disk image that can increase in size as needed - is actually a package, which has &quot;bands&quot; inside, many smaller files that are named hexadecimally. In this case, there were thousands of them. So many, that even deleting them from the command line didn't work - commands like &lt;tt&gt;rm&lt;/tt&gt; &lt;tt&gt;find&lt;/tt&gt; limitations in the lengths of lists parsed by recursion or wildcards, so a basic command like &lt;tt&gt;rm -f&lt;/tt&gt; didn't work.&lt;br&gt;&lt;br&gt; I ended up writing a li ...</description>
</item>
<item>
<title>Save all of your Terminal activity to a file</title>
<link>http://hints.macworld.com/article.php?story=20120507163311559</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120507163311559</guid>
<pubDate>Fri, 11 May 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120507163311559#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>I use Terminal everyday, and I find it a good idea to log everything I you. It makes it much easier to undo your mistakes when you know what those mistakes were. Here's how I do this:&lt;br&gt;&lt;br&gt; Open Terminal's preferences.&lt;br&gt;&lt;br&gt; Go to Settings, then Shell. You can choose here to run a command at startup. You could create a simple log of your session using the following:&lt;pre&gt;&lt;code&gt;/usr/bin/script ~/Desktop/Terminal.log&lt;/code&gt;&lt;/pre&gt;This will log everything you do and append it to the log file.&lt;br&gt;&lt;br&gt; I like to keep my history so instead I wrote this small script that archives previous sessions by renaming the file with a date/time string. I then set Terminal.app to run at startup the following command:&lt;pre&gt;&lt;code&gt;~/Desktop/logger.sh&lt;/code&gt;&lt;/pre&gt;Here's the script:&lt;pre&gt;&lt;code&gt;#!/bin/bash# logger.sh# Log everything you do in Terminal.#* Formatted date &amp;amp; time string.FORMATTED_DATE=`/bin/date &quot;+%Y-%m-%d%H%M%S&quot;`#* Archive the previous file/bin/cp -f ~/Desktop/Terminal ...&lt;/code&gt;&lt;/pre&gt;</description>
</item>
<item>
<title>Automatically restart network on lost connection </title>
<link>http://hints.macworld.com/article.php?story=2012041321461476</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=2012041321461476</guid>
<pubDate>Tue, 17 Apr 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=2012041321461476#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Often times, for whatever reason, the Internet connection on my Mac will lock up. Only restarting the Airport or Ethernet interfaces seem to resolve the issue in a timely manner. (This is different from a router crash which requires a manual restart of the router - in my case an Airport Extreme.) I have developed some interconnected scripts that will automatically accomplish this task for me when attached to launchctl. This is important for me because I often have to access files over the internet and if the connection has locked up there is no way for me to access them without manual intervention.&lt;br&gt;&lt;br&gt; The first script gets the active network interface. This is called by the second script which determines whether to run a matched script for either the Ethernet or AirPort interfaces. These third and fourth scripts restart either the Ethernet or AirPort connection respectively. These last two scripts can also be configured to send you an e-mail if this happens by altering the ' ...</description>
</item>
<item>
<title>Automatically reclaim memory from leaky programs</title>
<link>http://hints.macworld.com/article.php?story=20120410153721860</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120410153721860</guid>
<pubDate>Wed, 11 Apr 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120410153721860#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Sometimes applications have a nasty habit of claiming a lot of memory and never releasing it back to the system. Over time, this can cause affect performance. Most of the time, this can simply be fixed by quitting and restarting the offending program, but I wanted to find a more elegant solution.&lt;br&gt;&lt;br&gt; After searching the Internet, I found few scripts that I could tweak to achieve what I wanted. Heres what I came up with. The first script is a python script I found at &lt;a href=&quot;http://stackexchange.com/&quot;&gt;StackExchange&lt;/a&gt; by user drfrogsplat that gets information about system memory. The second is a bash script I wrote that runs the purge command if you have over a certain amount of inactive memory, in my case 500MB (probably overkill). Note that I think you need developer tools installed to use the purge command. There's probably an easier way to do this with vm_stat directly but I'm not good enough at awk/grep/sed to it figure out.&lt;br&gt;&lt;br&gt; The bash script can be attached to  ...</description>
</item>
<item>
<title>Getting and setting printer options from the command line for use with lpadmin</title>
<link>http://hints.macworld.com/article.php?story=20120313110411984</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120313110411984</guid>
<pubDate>Fri, 16 Mar 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120313110411984#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>lpadmin and lpoptions don't interact with OS X as you might think, or at least as they are documented. Here are some helpful notes and a script.&lt;br&gt;There are some good hints for adding printers via the command line with lpadmin: &lt;a href=&quot;http://hints.macworld.com/article.php?story=20061203221317612&quot;&gt;Managing multiple printers via the command line&lt;/a&gt;.&lt;br&gt;However, there is still confusion surrounding the setting of printer options from the command line, as a poster to Debian bugs pointed out back in 2006: &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=381252&quot;&gt;lpoptions documentation doesn't&lt;/a&gt;. After doing some testing, here are the two main points to note:&lt;br&gt;&lt;br&gt;&lt;li&gt;If you use lpadmin and specify options with &quot;-o&quot;, the PPD is altered and OS X will recognize the options for the printer. &lt;li&gt;However, if you setup the printer using lpadmin without any options, and later use lptoptions to set the options, they are not written to the PPD and the GUI is unaware of the pr ...&lt;/li&gt;&lt;/li&gt;</description>
</item>
<item>
<title>10.7: Fix crash when running shell scripts from script menu</title>
<link>http://hints.macworld.com/article.php?story=20120127032453655</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120127032453655</guid>
<pubDate>Wed, 14 Mar 2012 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120127032453655#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>It seems that 10.7 no longer wants to run shell scripts from the script menu. This may also happen in 10.6, but I do not have an install to test it with.&lt;br&gt;&lt;br&gt; No matter what script I try, the SystemUIServer crashes. And somewhere in the crash report is this ominous message:&lt;br&gt;&lt;br&gt; USING_FORK_WITHOUT_EXEC_IS_NOT_SUPPORTED_BY_FILE_MANAGER&lt;br&gt;&lt;br&gt; This might have something to do with Apple tightening privileges for spawning processes, but it can be easily fixed by enclosing the shell script in AppleScript.&lt;br&gt;&lt;pre&gt;&lt;code&gt;do shell script &quot;sh ~/script.sh&quot;&lt;/code&gt;&lt;/pre&gt;[&lt;b&gt;kirkmc adds&lt;/b&gt;: I haven't tested this; I don't run shell scripts from the script menu, so I haven't seen crashes.] 
</description>
</item>
<item>
<title>Control+T in Terminal shows time snapshot</title>
<link>http://hints.macworld.com/article.php?story=20110810112318227</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20110810112318227</guid>
<pubDate>Fri, 27 Jan 2012 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20110810112318227#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Not sure if this was available before 10.7, but hitting Control+T while running a command in the Terminal will show what process is executing, the load, the PID of the process and its user and kernel time.&lt;br&gt;&lt;br&gt;I was running a script and accidentally hit Control+T instead of Command+T to create a new tab. I was surprised at what I got. Here is an example of what gets printed:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:120px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;# buildOrder.pyload: 2.51  cmd: p4 15179 running 0.00u 0.00sload: 2.23  cmd: p4 17962 waiting 0.01u 0.00sload: 2.53  cmd: Python 15167 running 94.68u 66.33sload: 2.60  cmd: Python 15167 running 150.71u 101.82s&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;[&lt;b&gt;crarko adds:&lt;/b&gt; I wasn't able to reproduce this, but it may be due to the briefness of the running command. Give it a try and post a comment about your results. Try it in Snow Leopard too if you  ...</description>
</item>
<item>
<title>Convert Clipboard contents to plain text</title>
<link>http://hints.macworld.com/article.php?story=20120114032406552</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20120114032406552</guid>
<pubDate>Tue, 17 Jan 2012 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20120114032406552#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>There was a &lt;a href=&quot;http://www.macworld.com/article/164804/2012/01/promising_prospect_clipboard_cleaner_automatically_strips_formatting_from_the_clipboard.html#lsrc.rss_main&quot;&gt;recent article&lt;/a&gt; on the Macworld main site about apps you can buy that will strip formatting from text on the clipboard, leaving you with plain text that you can paste into documents without it having the wrong font, etc.&lt;br&gt;&lt;br&gt;Although some of them do this automatically, I thought it's a bit much to pay for such a simple utility that can be done in one line on the CLI.&lt;br&gt;&lt;br&gt;So here's a shell script that will convert the contents of the clipboard to plain text.&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:120px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;#!/bin/bash## Convert contents of clipboard to plain text.pbpaste | textutil -convert txt -stdin -stdout -encoding 30 | pbcopyexit 0&lt;/pre&gt;&lt;/div&gt;The encoding ...</description>
</item>
<item>
<title>Compress all the PNG files in your Home directory</title>
<link>http://hints.macworld.com/article.php?story=20111122135810992</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20111122135810992</guid>
<pubDate>Wed, 23 Nov 2011 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20111122135810992#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>PNG image files are often not compressed with the optimal compression setting, however a one line command can fix this (and save some space).&lt;br&gt;&lt;br&gt;Basically, one just needs to have &lt;a href=&quot;http://www.macports.org/&quot;&gt;MacPorts&lt;/a&gt; and the &lt;a href=&quot;https://trac.macports.org/browser/trunk/dports/graphics/optipng/Portfile&quot;&gt;optipng&lt;/a&gt; port installed, and run the following command:&lt;div style=&quot;margin-left: 20px; margin-top:10px; margin-bottom:10px; padding: 5px; border:1px solid; width:520px; height:60px; overflow:scroll;white-space:nowrap;resize:both&quot;&gt;&lt;pre&gt;mdfind -0 -onlyin ~ &quot;kMDItemContentType=public.png&quot; | xargs -n 5 -0 optipng -preserve&lt;/pre&gt;&lt;/div&gt;For more details, see this &lt;a href=&quot;http://wiesmann.codiferes.net/wordpress/?p=11273&quot;&gt;blog entry&lt;/a&gt;.&lt;br&gt;&lt;br&gt;[&lt;b&gt;crarko adds:&lt;/b&gt; I haven't tested this one. Note that to use MacPorts you also need to have Xcode installed to compile the ports. If you already have MacPorts set up give this hint a try and let us know how efficient th ...</description>
</item>
<item>
<title>Try the GIMP version 2.7.3 in OS X</title>
<link>http://hints.macworld.com/article.php?story=20111117032604297</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20111117032604297</guid>
<pubDate>Thu, 17 Nov 2011 07:30:00 -0800</pubDate>
<comments>http://hints.macworld.com/article.php?story=20111117032604297#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>In a previous hint, I suggested to install the development version of the GIMP (which also has the new, well-known single window mode) in an Ubuntu virtual machine: which obviously wasn't an optimal solution.&lt;br&gt;&lt;br&gt;Now, there is another option: install the GIMP 2.7.3 via MacPorts; here's how to do it.&lt;br&gt;&lt;br&gt;First of all, if you don't have it yet, you need to install MacPorts, available from &lt;a href=&quot;http://www.macports.org/install.php&quot;&gt;here&lt;/a&gt;.&lt;br&gt;&lt;br&gt;It is always a good thing to do a selfupdate; in the Terminal type:&lt;br&gt;&lt;br&gt;&lt;tt&gt;&amp;#36; sudo port selfupdate&lt;/tt&gt;&lt;br&gt;&lt;br&gt;Now, we can install the GIMP's development version (currently available in version 2.7.3):&lt;br&gt;&lt;br&gt;&lt;tt&gt;&amp;#36; sudo port install gimp2-devel&lt;/tt&gt;&lt;br&gt;&lt;br&gt;There are also many, many dependencies, and thus many packages to compile form source, so you must be patient; it can take several hours (for me, on a 2010 Core 2 Duo Mac mini Server with 8 GB of RAM, it took approximately 5 hours).&lt;br&gt;&lt;br&gt;Once installe ...</description>
</item>
<item>
<title>10.7: Removing a Delay in SSH commands to some hosts</title>
<link>http://hints.macworld.com/article.php?story=20111020115417965</link>
<guid isPermaLink="true">http://hints.macworld.com/article.php?story=20111020115417965</guid>
<pubDate>Tue, 25 Oct 2011 07:30:00 -0700</pubDate>
<comments>http://hints.macworld.com/article.php?story=20111020115417965#comments</comments>
<dc:subject>UNIX</dc:subject>
<description>Using SSH to connect to some servers can introduce long delays from the time the command is issued until the connection with the server is established. This hint describes two potential problems and offers a solution.&lt;br&gt;&lt;br&gt;In connecting to a local server, my ssh command would take about 20 seconds to complete. Non-Macintosh clients would not see this delay. After searching for the web and slogging through a number of posts that suggested how to change the server to fix ssh delays, I pieced together enough information to find out how to change my client configuration to solve the problem. &lt;br&gt;&lt;br&gt;The first, and largest cause of delays, was my client and the server working to authenticate me using 'GSSAPI' (Kerberos) authentication. That seemed to be a good 15-18 seconds of the delay. I fixed this problem by adding a configuration file for my user that disabled GSSAPI authentication for the host. The file I added is &lt;em&gt;~/.ssh/config&lt;/em&gt; and I created it to read:  ...</description>
</item>
</channel>
</rss>
