<?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>blogt0sk1 &#187; Bash</title>
	<atom:link href="http://blog.jerodsanto.net/category/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jerodsanto.net</link>
	<description>with Jerod Santo</description>
	<lastBuildDate>Sat, 19 Jun 2010 14:34:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Managing Broken Symlinks</title>
		<link>http://blog.jerodsanto.net/2009/11/managing-broken-symlinks/</link>
		<comments>http://blog.jerodsanto.net/2009/11/managing-broken-symlinks/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 16:02:32 +0000</pubDate>
		<dc:creator>Jerod</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[symlinks]]></category>

		<guid isPermaLink="false">http://blog.jerodsanto.net/?p=751</guid>
		<description><![CDATA[I just added two new functions to my bashrc which make it super-simple to find &#038; remove broken symbolic links on your system. They&#8217;re simple wrappers around the ever-useful &#8220;find&#8221; utility: function find_broken_symlinks&#40;&#41; &#123; find -x -L &#34;${1-.}&#34; -type l; &#125; function rm_broken_symlinks&#40;&#41; &#123; find -x -L &#34;${1-.}&#34; -type l -exec rm &#123;&#125; +; &#125; [...]]]></description>
			<content:encoded><![CDATA[<p>I just added two new functions to my <a href="http://github.com/sant0sk1/dotfiles/blob/master/bashrc" rel="external">bashrc</a> which make it super-simple to find &#038; remove broken symbolic links on your system.</p>
<p>They&#8217;re simple wrappers around the ever-useful &#8220;find&#8221; utility:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000; font-weight: bold;">function</span> find_broken_symlinks<span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#123;</span> <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-x</span> <span style="color: #660033;">-L</span> <span style="color: #D14;">&quot;<span style="color: #007800;">${1-.}</span>&quot;</span> <span style="color: #660033;">-type</span> l; <span style="color: #000;">&#125;</span>
<span style="color: #000; font-weight: bold;">function</span> rm_broken_symlinks<span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#123;</span> <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-x</span> <span style="color: #660033;">-L</span> <span style="color: #D14;">&quot;<span style="color: #007800;">${1-.}</span>&quot;</span> <span style="color: #660033;">-type</span> l <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000;">&#123;</span><span style="color: #000;">&#125;</span> +; <span style="color: #000;">&#125;</span></pre></div></div>

<p>You can call the functions with a specific path:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">jerod@mbp:~$ find_broken_symlinks /usr/local/bin</pre></div></div>

<p>Or you can call them sans argument to search your current working directory:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">jerod@mbp:~$ find_broken_symlinks</pre></div></div>

<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jerodsanto.net/2009/11/managing-broken-symlinks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
