<?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>Mac Tricks And Tips &#187; Terminal</title>
	<atom:link href="http://www.mactricksandtips.com/category/terminal/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mactricksandtips.com</link>
	<description>The best Mac tips, tricks reviews and tutorials.</description>
	<lastBuildDate>Tue, 01 May 2012 17:55:02 +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>Have Multiple Instances Of VLC or QuickTime to Play Movies or Music</title>
		<link>http://www.mactricksandtips.com/2012/05/have-multiple-instances-of-vlc-or-quicktime-to-play-movies-or-music.html</link>
		<comments>http://www.mactricksandtips.com/2012/05/have-multiple-instances-of-vlc-or-quicktime-to-play-movies-or-music.html#comments</comments>
		<pubDate>Tue, 01 May 2012 17:55:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=2668</guid>
		<description><![CDATA[Here is a trick that will allow you to have two or more instances of VLC or Quicktime Player open, which can allow you to play more than one movie at the same time. This is useful if you are in an environment where you have an attached monitor and want to play one movie on one screen, and a second movie on a different screen. All running from the same Mac. This tip can also be used to play more than one movie or music file (or any media) at the same time. Useful if you want to watch a whole season of The Simpsons, but don't have to time to watch them individually.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/05/have-multiple-instances-of-vlc-or-quicktime-to-play-movies-or-music.html">Have Multiple Instances Of VLC or QuickTime to Play Movies or Music</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2009/10/automatically-play-videos-in-quicktime-player.html' rel='bookmark' title='Permanent Link: Automatically Play Videos In QuickTime Player'>Automatically Play Videos In QuickTime Player</a></li>
<li><a href='http://www.mactricksandtips.com/2011/01/play-mkv-matroska-files-on-your-mac.html' rel='bookmark' title='Permanent Link: Play mkv (Matroska) Files On Your Mac'>Play mkv (Matroska) Files On Your Mac</a></li>
<li><a href='http://www.mactricksandtips.com/2010/02/capture-your-screen-with-quicktime.html' rel='bookmark' title='Permanent Link: Capture Your Screen With QuickTime'>Capture Your Screen With QuickTime</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>Here is a trick that will allow you to have two or more instances of VLC or Quicktime Player open, which can allow you to play more than one movie at the same time. This is useful if you are in an environment where you have an attached monitor and want to play one movie on one screen, and a second movie on a different screen. All running from the same Mac. This tip can also be used to play more than one movie or music file (or any media) at the same time. Useful if you want to watch a whole season of <a href="&quot;http://www.amazon.com/gp/product/B00005ML6Y/ref=as_li_ss_tl?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00005ML6Y">The Simpsons</a>, but don&#8217;t have to time to watch them individually.</p>
<h3>Opening Up More Than One Media Player</h3>
<p>To be able to play more than one media file at a time, using the same app, we need to open more than one instance of the media player. I have tested this command with VLC and Quicktime Player, I assume that it will work with any other app as well. If you try double clicking on the app in Finder it will only open one copy. To get round this we are going to use Terminal and force it to open more than one version. Therefore, open Terminal located in Applications &gt; Utilities and type the following:</p>
<p><code>open -n /Applications/VLC.app</code></p>
<p>and the following if you want to use Quicktime Player:</p>
<p><code>open -n /Applications/QuickTime\ Player.app</code></p>
<p>If you have your apps stored in a different location, all you have to do in Terminal is type <code>open -n</code> and then drag and drop your app onto the Terminal window.</p>
<p>Simply repeat the command for every instance of the app you want open. If you need two media players, use the command twice. For quickly repeating previous commands in Terminal, press the up arrow to load in the previous command.</p>
<p>The final step is to load the file which you do the normal method. Either use the File &gt; Open menu bar item or drag and drop the media onto the window. You have to keep track of which app you are using as there will be two or more instances of the app in the dock.</p>
<p>You can now play the files at the same time, in different or the same screen all day long. Useful if you Mac is connected to a media outlet in a shop or other venue.</p>
<h3>Syncing File Start Times  / Automatically Loading a Play List</h3>
<p>If you want the media you have selected to start playing at the same time in each instance, or you want to automatically load a play list, you can do this in Terminal as well. You can also load the file to play from Terminal using the same method. Simply type the following:</p>
<p><code><code>open -na /Applications/VLC.app /path/to/playlist/or/media/file; open -na /Applications/VLC.app /second/instance/path/to/playlist/or/media/file;</code></code></p>
<p>The -n option loads the app, and the -a option ensures the play list file is opened with the app you have selected and not the default app. The repetition of the open command is split between the semi colon, which is defined as a new command in Terminal. Simply select the file you want to play or the playlist you have created. Note that you can use the first half of the command to open VLC and play the file. What actually goes on is Terminal opens one instance and begins playing, then opens a second instance and then plays that file. However, since the gap between the two is so small you don&#8217;t notice it. If you find the path is too long to type, or has plenty of spaces, you can drag and drop the file onto the Terminal window to automatically load the file path.</p>
<p>Once the command has ran, you will have two copies open of VLC or Quicktime playing the movies or music file from 00:00 at the same time. You can repeat this command depending on how many instances you want open.</p>
<p>It is worth noting that each instance you open takes up bandwidth to your hard drive. Use Activity Monitor in the Utilities folder to measure how much disk access you are using, and when you will reach the limit. If you find your Mac stuttering when playing a couple of files at the same time, it is because your Mac can&#8217;t access the disk quick enough to play the files.</p>
<p>If you have any questions or comments about this trick, please leave one below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/05/have-multiple-instances-of-vlc-or-quicktime-to-play-movies-or-music.html">Have Multiple Instances Of VLC or QuickTime to Play Movies or Music</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2009/10/automatically-play-videos-in-quicktime-player.html' rel='bookmark' title='Permanent Link: Automatically Play Videos In QuickTime Player'>Automatically Play Videos In QuickTime Player</a></li>
<li><a href='http://www.mactricksandtips.com/2011/01/play-mkv-matroska-files-on-your-mac.html' rel='bookmark' title='Permanent Link: Play mkv (Matroska) Files On Your Mac'>Play mkv (Matroska) Files On Your Mac</a></li>
<li><a href='http://www.mactricksandtips.com/2010/02/capture-your-screen-with-quicktime.html' rel='bookmark' title='Permanent Link: Capture Your Screen With QuickTime'>Capture Your Screen With QuickTime</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ignore / Disable File Extension Change Warning</title>
		<link>http://www.mactricksandtips.com/2012/04/ignore-disable-file-extension-change-warning.html</link>
		<comments>http://www.mactricksandtips.com/2012/04/ignore-disable-file-extension-change-warning.html#comments</comments>
		<pubDate>Mon, 23 Apr 2012 19:14:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=2655</guid>
		<description><![CDATA[Every time you change the extension of a file, whether it be an image, movie or a system file you Mac will throw up a warning telling you about the change. Although this is useful most of the time, sometimes you may just want to get rid of it and ignore the warning. Thankfully I was given a solution to this problem allowing you to change this setting with Terminal. From my understanding this tip works in Lion and Snow Leopard, it probably works with older version too.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/04/ignore-disable-file-extension-change-warning.html">Ignore / Disable File Extension Change Warning</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/04/change-the-modification-time-of-a-file.html' rel='bookmark' title='Permanent Link: Change The Modification Time Of A File'>Change The Modification Time Of A File</a></li>
<li><a href='http://www.mactricksandtips.com/2010/03/disable-quarantine-msg-when-downloading-files.html' rel='bookmark' title='Permanent Link: Disable Quarantine Msg When Downloading Files'>Disable Quarantine Msg When Downloading Files</a></li>
<li><a href='http://www.mactricksandtips.com/2009/06/disable-dock-bouncing.html' rel='bookmark' title='Permanent Link: Disable Dock Bouncing'>Disable Dock Bouncing</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>Every time you change the extension of a file, whether it be an image, movie or a system file you Mac will throw up a warning telling you about the change. Although this is useful most of the time, sometimes you may just want to get rid of it and ignore the warning. Thankfully I was given a solution to this problem allowing you to change this setting with Terminal. From my understanding this tip works in Lion and Snow Leopard, it probably works with older version too.</p>
<div id="attachment_2656" class="wp-caption aligncenter" style="width: 430px"><a href="http://www.mactricksandtips.com/wp-content/uploads/2012/04/extension-warning.png"><img class="size-full wp-image-2656" title="extension-warning" src="http://www.mactricksandtips.com/wp-content/uploads/2012/04/extension-warning.png" alt="" width="420" height="159" /></a><p class="wp-caption-text">The annoying warning dialog box. Easy to get rid of.</p></div>
<p>To remove the warning open up Terminal located in Applications &gt; Utilities. Copy and paste the following:</p>
<p><code>defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false; killall Finder</code></p>
<p>This will change the setting and restart Finder so the change takes effect. The warning dialog box will not appear</p>
<p>If you want to revert the change type the following:</p>
<p><code>defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true; killall Finder</code></p>
<p>Its only a simple change, however one that I find useful. Really useful if you want to change a lot of file extensions and don&#8217;t want to constantly accept the change.</p>
<p>If you have any questions about this tip, please leave a comment.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/04/ignore-disable-file-extension-change-warning.html">Ignore / Disable File Extension Change Warning</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/04/change-the-modification-time-of-a-file.html' rel='bookmark' title='Permanent Link: Change The Modification Time Of A File'>Change The Modification Time Of A File</a></li>
<li><a href='http://www.mactricksandtips.com/2010/03/disable-quarantine-msg-when-downloading-files.html' rel='bookmark' title='Permanent Link: Disable Quarantine Msg When Downloading Files'>Disable Quarantine Msg When Downloading Files</a></li>
<li><a href='http://www.mactricksandtips.com/2009/06/disable-dock-bouncing.html' rel='bookmark' title='Permanent Link: Disable Dock Bouncing'>Disable Dock Bouncing</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Change The Modification Time Of A File</title>
		<link>http://www.mactricksandtips.com/2012/04/change-the-modification-time-of-a-file.html</link>
		<comments>http://www.mactricksandtips.com/2012/04/change-the-modification-time-of-a-file.html#comments</comments>
		<pubDate>Mon, 16 Apr 2012 18:31:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=2646</guid>
		<description><![CDATA[Here is a rather cool trick that allows you to change the modification time of a file. There may be a variety of reasons for changing the modification time of a file, usually get an app to work with the file. Making the change is simple and involves a simple in built command within Terminal.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/04/change-the-modification-time-of-a-file.html">Change The Modification Time Of A File</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2009/06/back-date-a-file-using-terminal.html' rel='bookmark' title='Permanent Link: Back Date A File Using Terminal'>Back Date A File Using Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2012/04/ignore-disable-file-extension-change-warning.html' rel='bookmark' title='Permanent Link: Ignore / Disable File Extension Change Warning'>Ignore / Disable File Extension Change Warning</a></li>
<li><a href='http://www.mactricksandtips.com/2010/09/determine-which-processesapp-is-using-a-file.html' rel='bookmark' title='Permanent Link: Determine Which Processes/App Is Using A File'>Determine Which Processes/App Is Using A File</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>Here is a rather cool trick that allows you to change the modification time of a file. There may be a variety of reasons for changing the modification time of a file, usually get an app to work with the file. Making the change is simple and involves a simple in built command within Terminal.</p>
<p>To change the files modification date open up Terminal located within Application &gt; Utilities. Then type the following:</p>
<p><code>touch -mt YYYYMMDDhhmm /path/to/file</code></p>
<p>Where YYYY is the year, MM is the month, DD is the day, hh the hour and mm the minutes. For example today&#8217;s date, 16th of April, 2012 at 19:26, would be written as follows: 201204161926. You need all but values for the best effect. The path to file section can be simplified by dragging and dropping the file on to the Terminal window after you have written the command.</p>
<p>When you hit the return key the command will alter the modification date of the file. Note that if you modify the file in another app, the current time and date will added.</p>
<p>If you want to know more about the touch command you can type the following into Terminal:</p>
<p><code>man touch</code></p>
<p>This will give you the manual for the command.</p>
<p>If you have any questions or comments, please leave one using the form below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/04/change-the-modification-time-of-a-file.html">Change The Modification Time Of A File</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2009/06/back-date-a-file-using-terminal.html' rel='bookmark' title='Permanent Link: Back Date A File Using Terminal'>Back Date A File Using Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2012/04/ignore-disable-file-extension-change-warning.html' rel='bookmark' title='Permanent Link: Ignore / Disable File Extension Change Warning'>Ignore / Disable File Extension Change Warning</a></li>
<li><a href='http://www.mactricksandtips.com/2010/09/determine-which-processesapp-is-using-a-file.html' rel='bookmark' title='Permanent Link: Determine Which Processes/App Is Using A File'>Determine Which Processes/App Is Using A File</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View Which Files Are Being Used By Running Apps</title>
		<link>http://www.mactricksandtips.com/2012/03/view-whichs-files-are-being-used-by-running-apps.html</link>
		<comments>http://www.mactricksandtips.com/2012/03/view-whichs-files-are-being-used-by-running-apps.html#comments</comments>
		<pubDate>Mon, 12 Mar 2012 19:29:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=2598</guid>
		<description><![CDATA[This little trick I came across while I wondered why my hard disk was being used when no apps were actively running. Its a basic Terminal command that shows you which files are being accessed and by which program. Its very useful and customisable, and interesting to watch to see how you Mac uses the files stored on your hard disk. You can use it when a file is in use or an app is accessing your disk. The resulting output is great for determining if you have a rogue app accessing files it shouldn't or if an app is heavy on file access, something which can slow your Mac down.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/03/view-whichs-files-are-being-used-by-running-apps.html">View Which Files Are Being Used By Running Apps</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/07/changes-view-changes-between-files.html' rel='bookmark' title='Permanent Link: Changes &#8211; View Changes Between Files'>Changes &#8211; View Changes Between Files</a></li>
<li><a href='http://www.mactricksandtips.com/2012/01/view-terminal-man-pages-in-preview-pdf.html' rel='bookmark' title='Permanent Link: View Terminal &#8216;man&#8217; Pages In Preview / PDF'>View Terminal &#8216;man&#8217; Pages In Preview / PDF</a></li>
<li><a href='http://www.mactricksandtips.com/2011/01/find-files-in-use-using-activity-monitor.html' rel='bookmark' title='Permanent Link: Find Files In Use Using Activity Monitor'>Find Files In Use Using Activity Monitor</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>This little trick I came across while I wondered why my hard disk was being used when no apps were actively running. Its a basic Terminal command that shows you which files are being accessed and by which program. Its very useful and customisable, and interesting to watch to see how you Mac uses the files stored on your hard disk. You can use it when a file is in use or an app is accessing your disk. The resulting output is great for determining if you have a rogue app accessing files it shouldn&#8217;t or if an app is heavy on file access, something which can slow your Mac down.</p>
<h3>The Terminal Command</h3>
<p>The Terminal command we are going to use is <code>opensnoop</code>. Although there are plenty of different commands out there that can probably do the same thing, this is one that is built into your Mac and is pretty easy to use. To access it open Terminal found in Applications &gt; Utilities and type the following:</p>
<p><code>sudo opensnoop</code></p>
<p>You have to use <a href="http://en.wikipedia.org/wiki/Sudo">sudo</a> since the command will access system files which need administrator privileges.</p>
<div id="attachment_2599" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.mactricksandtips.com/wp-content/uploads/2012/03/opensnoop-screenshot.png"><img class="size-medium wp-image-2599" title="opensnoop-screenshot" src="http://www.mactricksandtips.com/wp-content/uploads/2012/03/opensnoop-screenshot-600x285.png" alt="" width="600" height="285" /></a><p class="wp-caption-text">Opensnoop showing in red the user (UID), the app accessing the file in green and the file location in blue.</p></div>
<p>When you run the command the text will probably wizz by. You can always stop the command my pressing Control + C</p>
<h3>Customising The Command</h3>
<p>The command on its own is interesting, but outputs too much information all at once to be meaningful. We need to customise it using the built in in options. The first is to add a date, this makes working out the access time later easier. This is accomplished using the command:</p>
<p><code>sudo opensnoop -v</code></p>
<p>We can narrow down the search to an app by using the following command:</p>
<p><code>opensnoop -n Finder</code></p>
<p>Either type in the app name as it appears within opensnoop or the PID, which can be found using Activity Monitor.</p>
<p>If you want to see when a file gets accessed and by the program responsible you can write the following:</p>
<p><code>sudo opensnoop -f /path/to/file</code></p>
<p>You can always drag and drop the file into the Terminal window instead of typing /path/to/file.</p>
<p>If you want to save the output you can always use the following command</p>
<p><code>sudo opensnoop &gt; /saved/file/path/text.txt</code></p>
<p>This will create a new file and write the output to the file. When you close Terminal it will complete the file. If you want to add to the end of a file, because you have used the text file before, use double arrows (&gt;&gt;)</p>
<h3>User Identifier / UID</h3>
<p>One of the features of opensnoop is the UID or <a href="http://en.wikipedia.org/wiki/User_%28computing%29">Unique Identifier</a>. It defines which person whether it be yourself or user built into your Mac such as admin, is using a file. For example if I open a file and opensnoop captures it (which it does) it will list a UID or 501. This basically tells me that I have open the file. However you will soon notice that other UID&#8217;s are using files, these are responsible for your background tasks.</p>
<p>To find a UID and associate it with a physical user we have two options you can use. In Terminal type the following:</p>
<p><code>id</code></p>
<p>This will give you a short list correlating UID&#8217;s to names. In this list the user 501, is reported as James.</p>
<p>If a UID doesn&#8217;t appear in this list, you can use a more expansive system list. In Terminal again type the following:</p>
<p><code>open /etc/passwd</code></p>
<p>TextEdit will open a file with lots of UID&#8217;s. Do not change anything in this file. You will however notice a name and a number associated with it. For example in the image above there is a UID of 89. In my passwd file this is linked to spotlight. I then know that spotlight was accessing a file to do what ever it has to do. You can do this will all of the users that appear. When you have finished with the passwd file, close TextEdit.</p>
<p>Its worth noteing at this point that FD stands for <a href="http://en.wikipedia.org/wiki/File_descriptor">File Descriptor</a>. You can read up on it at Wikipedia.</p>
<h3>Conclusion</h3>
<p>This command isn&#8217;t that complicated but pretty powerful. If you want to find more customisable options you can use the man page accessible by typing in the following:</p>
<p><code>man opensnoop</code></p>
<p>If have used this command to see which files an app access and which files are locked by programs. Useful if you want to restart or clear the trash and Finder says a file is in use.</p>
<p>If you have any tips in using this Terminal command, please leave a comment below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/03/view-whichs-files-are-being-used-by-running-apps.html">View Which Files Are Being Used By Running Apps</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/07/changes-view-changes-between-files.html' rel='bookmark' title='Permanent Link: Changes &#8211; View Changes Between Files'>Changes &#8211; View Changes Between Files</a></li>
<li><a href='http://www.mactricksandtips.com/2012/01/view-terminal-man-pages-in-preview-pdf.html' rel='bookmark' title='Permanent Link: View Terminal &#8216;man&#8217; Pages In Preview / PDF'>View Terminal &#8216;man&#8217; Pages In Preview / PDF</a></li>
<li><a href='http://www.mactricksandtips.com/2011/01/find-files-in-use-using-activity-monitor.html' rel='bookmark' title='Permanent Link: Find Files In Use Using Activity Monitor'>Find Files In Use Using Activity Monitor</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cancel Print Jobs From Terminal</title>
		<link>http://www.mactricksandtips.com/2012/02/cancel-print-jobs-from-terminal.html</link>
		<comments>http://www.mactricksandtips.com/2012/02/cancel-print-jobs-from-terminal.html#comments</comments>
		<pubDate>Mon, 27 Feb 2012 20:23:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=2529</guid>
		<description><![CDATA[This is a quick command I stumbled upon while looking around the folder that contains all of the binary files Terminal runs on. One of these commands is cancel, and is design to cancel print jobs from your Mac while in Terminal. This would be very useful for anyone who is building a script or wants a different way of canceling print jobs. This command can also run over a network and can remove print jobs only from certain users.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/cancel-print-jobs-from-terminal.html">Cancel Print Jobs From Terminal</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/09/print-selected-information-from-terminal-commands.html' rel='bookmark' title='Permanent Link: Print Selected Info From Terminal Commands'>Print Selected Info From Terminal Commands</a></li>
<li><a href='http://www.mactricksandtips.com/2008/04/cancel-shutdown.html' rel='bookmark' title='Permanent Link: Cancel A Shutdown'>Cancel A Shutdown</a></li>
<li><a href='http://www.mactricksandtips.com/2008/06/print-envelopes-from-address-book.html' rel='bookmark' title='Permanent Link: Print Envelopes From Address Book'>Print Envelopes From Address Book</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>This is a quick command I stumbled upon while looking around the folder that contains all of the binary files Terminal runs on. One of these commands is <code>cancel</code>, and is design to cancel print jobs from your Mac while in Terminal. This would be very useful for anyone who is building a script or wants a different way of canceling print jobs. This command can also run over a network and can remove print jobs only from certain users.</p>
<p>To cancel your print job open up Terminal and type the following:</p>
<p><code>cancel -a</code></p>
<p>This will cancel all prints jobs on your connected Mac. If you have a printer over a network you can use the following command:<br />
<code><br />
cancel -a -h 192.186.0.1:[port]</code></p>
<p>This will cancel all of the print jobs on the IP address 192.168.0.1 with the required port number.</p>
<p>If you want to cancel selected jobs from certain users simply append, the -u option as follows:</p>
<p><code>cancel -a -U "James"</code></p>
<p>This will cancel all jobs by the user James. If your name has multiple words, ensure the name is in quote marks. To find the name that you or any users prints by, select job info from the print queue window.</p>
<p>Finally to view the man page of the cancel command, simply type:</p>
<p><code>man cancel</code></p>
<p>Its note a complicated command <code>cancel</code>, but may come in useful. If you have any questions or comments, please leave one below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/cancel-print-jobs-from-terminal.html">Cancel Print Jobs From Terminal</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/09/print-selected-information-from-terminal-commands.html' rel='bookmark' title='Permanent Link: Print Selected Info From Terminal Commands'>Print Selected Info From Terminal Commands</a></li>
<li><a href='http://www.mactricksandtips.com/2008/04/cancel-shutdown.html' rel='bookmark' title='Permanent Link: Cancel A Shutdown'>Cancel A Shutdown</a></li>
<li><a href='http://www.mactricksandtips.com/2008/06/print-envelopes-from-address-book.html' rel='bookmark' title='Permanent Link: Print Envelopes From Address Book'>Print Envelopes From Address Book</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate &amp; Compare MD5, SHA1 Hashes For Files In Terminal</title>
		<link>http://www.mactricksandtips.com/2012/02/generate-compare-md5-sha1-hashes-for-file-in-terminal.html</link>
		<comments>http://www.mactricksandtips.com/2012/02/generate-compare-md5-sha1-hashes-for-file-in-terminal.html#comments</comments>
		<pubDate>Wed, 22 Feb 2012 11:01:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=2511</guid>
		<description><![CDATA[A while back I mentioned an app that can compare files, this worked by comparing the hash of a file, essentially its make up at the byte level. This means, even though two files that are the same size in terms of bits, will be different because of the order of those bits generate a different hash number. This is very useful in comparing different files and ensuring you are working with the right file. All you have to do is compare the hashes of the two files and if they match you are good to go. Today's post will show you how you generate MD5 and SHA-1 hashes in Terminal.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/generate-compare-md5-sha1-hashes-for-file-in-terminal.html">Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/02/compare-wordpress-subversion-svn-files-with-terminal.html' rel='bookmark' title='Permanent Link: Compare WordPress (SVN) Files With Terminal'>Compare WordPress (SVN) Files With Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2012/01/generate-random-numbers-in-terminalbash.html' rel='bookmark' title='Permanent Link: Generate Random Numbers In Terminal/Bash'>Generate Random Numbers In Terminal/Bash</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/opening-terminal-files-in-a-different-app.html' rel='bookmark' title='Permanent Link: Opening Terminal Files In A Different App'>Opening Terminal Files In A Different App</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey,</p>
<p>A while back I mentioned an app that can <a href="http://www.mactricksandtips.com/2012/01/find-duplicate-files-on-your-mac.html">compare files</a>, this worked by comparing the <a href="http://en.wikipedia.org/wiki/Hash_function">hash</a> of a file, essentially its make up at the byte level. This means, even though two files that are the same size in terms of bits, will be different because of the order of those bits generate a different hash number. This is very useful in comparing different files and ensuring you are working with the right file. All you have to do is compare the hashes of the two files and if they match you are good to go. Today&#8217;s post will show you how you generate <a href="http://en.wikipedia.org/wiki/Md5">MD5</a> and <a href="http://en.wikipedia.org/wiki/Sha1">SHA-1</a> hashes in Terminal.</p>
<h3>Generating MD5</h3>
<p>The first stage is to open up Terminal and type the following to generate an MD5 hash.</p>
<p><code>md5</code></p>
<p>Then either type the file name and/or path, or better yet drop the file from Finder into the Terminal window, ensure there is a space after the md5. This will generate an ouput similar to the following:</p>
<p><code>md5 file.png<br />
MD5 (file.png) = 251b5c95860dca0b07b15e927fc0cc84</code></p>
<p>Very simple.</p>
<h3>Generating SHA-1</h3>
<p>Now, there is a better hash function called SHA-1, that produces a more accurate hash of the file you are wanting to check. To generate an SHA-1 file you need to use <a href="http://www.openssl.org/">openssl</a>, which should be installed on your Mac by default. To generate an SHA-1 hash type in the following, followed by the path to the file, or the file dropped onto the Finder window:</p>
<p><code>openssl sha1</code></p>
<p>For example:<br />
<code><br />
openssl sha1 file.png<br />
SHA1(file.png)= ba45256be13be6d30361e4541c5dfbe381c1c3be</code></p>
<p>Notice the longer number, you can use openssl for md5, just enter md5 instead of sha1.</p>
<p>This tip is very useful if you want to compare the hashes of the files you have downloaded from the Apple downloads page, for example <a href="http://support.apple.com/kb/DL1484">this page</a> has a hash at the bottom which you can compare to the one you have created for the file on your computer.</p>
<h3>Multiple Files</h3>
<p>If you want to generate hashes for multiple files, its really simple. The best method is to use Finder and openssl. In Finder type the command you want for the hash function you want to run (eg <code>openssl sha1</code>) and then drop all of the files you want to generate hashes for on to the Terminal window from Finder. Terminal will run through each file and output the hash function.</p>
<div id="attachment_2512" class="wp-caption aligncenter" style="width: 610px"><a href="http://www.mactricksandtips.com/wp-content/uploads/2012/02/sha1-hash-terminal-screenshot.png"><img class="size-medium wp-image-2512" title="sha1 hash terminal screenshot" src="http://www.mactricksandtips.com/wp-content/uploads/2012/02/sha1-hash-terminal-screenshot-600x204.png" alt="" width="600" height="204" /></a><p class="wp-caption-text">Terminal generating an sha1 hash for a group of files.</p></div>
<p style="text-align: center;">
<p>The hash function will take some time if you have massive files, but will quickly run on smaller files. I use this when I upload files to my server, or move them around on various networks, to ensure both files are exactly the same.</p>
<p>If you have any questions for comments, please leave one below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/generate-compare-md5-sha1-hashes-for-file-in-terminal.html">Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/02/compare-wordpress-subversion-svn-files-with-terminal.html' rel='bookmark' title='Permanent Link: Compare WordPress (SVN) Files With Terminal'>Compare WordPress (SVN) Files With Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2012/01/generate-random-numbers-in-terminalbash.html' rel='bookmark' title='Permanent Link: Generate Random Numbers In Terminal/Bash'>Generate Random Numbers In Terminal/Bash</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/opening-terminal-files-in-a-different-app.html' rel='bookmark' title='Permanent Link: Opening Terminal Files In A Different App'>Opening Terminal Files In A Different App</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compare WordPress (SVN) Files With Terminal</title>
		<link>http://www.mactricksandtips.com/2012/02/compare-wordpress-subversion-svn-files-with-terminal.html</link>
		<comments>http://www.mactricksandtips.com/2012/02/compare-wordpress-subversion-svn-files-with-terminal.html#comments</comments>
		<pubDate>Fri, 10 Feb 2012 19:47:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=2342</guid>
		<description><![CDATA[This is a quick simple trick that people using Wordpress or any program which uses subversion or SVN may find useful. Subversion is a version control system which lets people publish versions of software, such as Wordpress, to a simple repository. When they update the repository other people, such as Wordpress bloggers, can view the source files and then download and install them yourself. This tip shows you the difference in files between versions, and allows you just to change or download the files you need. This is useful in saving both time and effort as you don't have to download the entire package just the files that have changed between the version you have installed and the new version. <p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/compare-wordpress-subversion-svn-files-with-terminal.html">Compare WordPress (SVN) Files With Terminal</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/02/generate-compare-md5-sha1-hashes-for-file-in-terminal.html' rel='bookmark' title='Permanent Link: Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal'>Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/easily-delete-files-using-terminal.html' rel='bookmark' title='Permanent Link: Easily Delete Files Using Terminal'>Easily Delete Files Using Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2008/04/give-your-wordpress-admin-that-leopard.html' rel='bookmark' title='Permanent Link: Give Your WordPress Admin That Leopard Look'>Give Your WordPress Admin That Leopard Look</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>This is a quick simple trick that people using WordPress or any program which uses <a href="http://en.wikipedia.org/wiki/Apache_Subversion">subversion</a> or SVN may find useful. Subversion is a version control system which lets people publish versions of software, such as WordPress, to a simple repository. When they update the repository other people, such as WordPress bloggers, can view the source files and then download and install them yourself. This tip shows you the difference in files between versions, and allows you just to change or download the files you need. This is useful in saving both time and effort as you don&#8217;t have to download the entire package just the files that have changed between the version you have installed and the new version.</p>
<p>This tip works with any software that has revision control/subversion. I am going to pick WordPress as it is the most popular. If you head over the <a href="http://core.svn.wordpress.org/tags/">revision page</a> of WordPress you will notice, different versions of the WordPress platform. Each version has the entire source code which is used to run the blogging platform. If you are moving between versions there may only be a couple of files that have changed. Therefore to see the changed files type the following into Terminal.</p>
<p><code>svn diff --summarize http://core.svn.wordpress.org/tags/3.3/ http://core.svn.wordpress.org/tags/3.3.1/</code></p>
<p>Change the 3.3 and 3.3.1 to the versions you want to compare. This will output a result similar to the image below.</p>
<div id="attachment_2343" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mactricksandtips.com/wp-content/uploads/2012/02/terminal-subversion-screenshot.png"><img class="size-medium wp-image-2343" title="terminal subversion screenshot" src="http://www.mactricksandtips.com/wp-content/uploads/2012/02/terminal-subversion-screenshot-300x195.png" alt="" width="300" height="195" /></a><p class="wp-caption-text">Comparing two versions for WordPress.</p></div>
<p style="text-align: center;">In the first column the M stands for modified, so the file contents have been changed, this can be only one letter, but it still classes as modified. If the letter A appears, it means the file has been added. The letter D stands for deleted. The list then shows which files have been changed. If you remove the <code>--summarize</code> from the Terminal command you can see what changes have been made, however this soon fills up your Terminal screen if many changes have been added.</p>
<p>I know from the list that I only have to upload 14 files to my server for the new changes to take effect. This saves the time it takes to upload the entire package.</p>
<p>Its a simple trick, but any one who regularly uses WordPress or a program that utilises subversion will find this very useful</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/compare-wordpress-subversion-svn-files-with-terminal.html">Compare WordPress (SVN) Files With Terminal</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/02/generate-compare-md5-sha1-hashes-for-file-in-terminal.html' rel='bookmark' title='Permanent Link: Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal'>Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/easily-delete-files-using-terminal.html' rel='bookmark' title='Permanent Link: Easily Delete Files Using Terminal'>Easily Delete Files Using Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2008/04/give-your-wordpress-admin-that-leopard.html' rel='bookmark' title='Permanent Link: Give Your WordPress Admin That Leopard Look'>Give Your WordPress Admin That Leopard Look</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loop / Repeat Terminal Commands</title>
		<link>http://www.mactricksandtips.com/2012/02/loop-repeat-terminal-commands.html</link>
		<comments>http://www.mactricksandtips.com/2012/02/loop-repeat-terminal-commands.html#comments</comments>
		<pubDate>Mon, 06 Feb 2012 15:42:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=2142</guid>
		<description><![CDATA[I want to extend your Terminal knowledge today by introducing a simple loop command. This is useful if you want to repeat or loop a Terminal command indefinitely. This is a simple bash script that has a variety of uses. The script is a simple one line command that needs very little adjusting on your part.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/loop-repeat-terminal-commands.html">Loop / Repeat Terminal Commands</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/05/list-all-possible-terminal-commands.html' rel='bookmark' title='Permanent Link: List All Possible Terminal Commands'>List All Possible Terminal Commands</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/create-your-own-custom-terminal-commands.html' rel='bookmark' title='Permanent Link: Create Your Own Custom Terminal Commands'>Create Your Own Custom Terminal Commands</a></li>
<li><a href='http://www.mactricksandtips.com/2008/09/print-selected-information-from-terminal-commands.html' rel='bookmark' title='Permanent Link: Print Selected Info From Terminal Commands'>Print Selected Info From Terminal Commands</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>I want to extend your <a href="http://www.mactricksandtips.com/category/terminal">Terminal</a> knowledge today by introducing a simple loop command. This is useful if you want to repeat or loop a Terminal command indefinitely. This is a simple bash script that has a variety of uses. The script is a simple one line command that needs very little adjusting on your part.</p>
<p>The first step is to open up Terminal. Then copy and paste, or type, the following into the Terminal prompt.</p>
<p><code>bash -c 'while [ 0 ]; do date;done'</code></p>
<p>This will activate a bash script, and will repeat the listed command indefinitely, press Control + C to stop the loop. Replace the word <code>date</code>, with any command you want to run. This loop works when the program you want to run will have a defined exit. For example the command date will display the current date and time and then return you to the command prompt. A command such as <code>top</code>, will display the command but will immediately open the command again the second you exit <code>top</code>.</p>
<p>The loop listed will run the command as fast as possible, this is a little bit of overkill and the majority of commands are best used when a small amount of delay is present after each command is run. To achieve this in the loop we are going to add a sleep command, to pause the loop for a certain number of seconds. To add this into the loop type the following:</p>
<p><code>bash -c 'while [ 0 ]; do date;sleep 1;done'</code></p>
<p>This will cause the loop to pause for one second before it is repeated.</p>
<p>A simple loop that I will begin to implement in a couple of commands. If you want to learn more about bash programming I recommend <a href="http://www.amazon.com/gp/product/0596526784/ref=as_li_ss_tl?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596526784">Bash Cookbook</a>, among the many useful books found on Amazon. If you have any questions, comments or extensions to this code, please leave a comment using the form below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/loop-repeat-terminal-commands.html">Loop / Repeat Terminal Commands</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/05/list-all-possible-terminal-commands.html' rel='bookmark' title='Permanent Link: List All Possible Terminal Commands'>List All Possible Terminal Commands</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/create-your-own-custom-terminal-commands.html' rel='bookmark' title='Permanent Link: Create Your Own Custom Terminal Commands'>Create Your Own Custom Terminal Commands</a></li>
<li><a href='http://www.mactricksandtips.com/2008/09/print-selected-information-from-terminal-commands.html' rel='bookmark' title='Permanent Link: Print Selected Info From Terminal Commands'>Print Selected Info From Terminal Commands</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stress Test Your Mac and CPU</title>
		<link>http://www.mactricksandtips.com/2012/02/stress-test-your-mac-and-cpu.html</link>
		<comments>http://www.mactricksandtips.com/2012/02/stress-test-your-mac-and-cpu.html#comments</comments>
		<pubDate>Sat, 04 Feb 2012 14:49:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1956</guid>
		<description><![CDATA[When you have a new or old Mac, every so often you will want to stress test your Mac to see if it has any problems or it can handle the heat. There are a variety of different ways in which you can do this, however one of the simplest ways is to use Terminal. This guide will show you how to set your CPU running at max speed, which you can tailor to the number of CPU's cores you have. Then its just a matter of watching the results in Activity Monitor, watch for stability issues and see the temperature of your Mac rise.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/stress-test-your-mac-and-cpu.html">Stress Test Your Mac and CPU</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/04/test-the-disk-speed-of-your-hard-drives.html' rel='bookmark' title='Permanent Link: Test The Disk Speed Of Your Hard Drives'>Test The Disk Speed Of Your Hard Drives</a></li>
<li><a href='http://www.mactricksandtips.com/2011/01/find-files-in-use-using-activity-monitor.html' rel='bookmark' title='Permanent Link: Find Files In Use Using Activity Monitor'>Find Files In Use Using Activity Monitor</a></li>
<li><a href='http://www.mactricksandtips.com/2012/05/have-multiple-instances-of-vlc-or-quicktime-to-play-movies-or-music.html' rel='bookmark' title='Permanent Link: Have Multiple Instances Of VLC or QuickTime to Play Movies or Music'>Have Multiple Instances Of VLC or QuickTime to Play Movies or Music</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>When you have a new or old Mac, every so often you will want to stress test your Mac to see if it has any problems or it can handle the heat. There are a variety of different ways in which you can do this, however one of the simplest ways is to use Terminal. This guide will show you how to set your CPU running at max speed, which you can tailor to the number of CPU&#8217;s cores you have. Then its just a matter of watching the results in Activity Monitor, watch for stability issues and see the temperature of your Mac rise.</p>
<p>The first step is to open Activity Monitor located in Applications &gt; Utilities folder. Set the entries in the list view to be ordered by CPU %, so you can see what is using your computer. Then, if required, install an app to monitor the temperature of your Mac. I recommend <a href="http://islayer.com/apps/">iStat</a>, either the dashboard or menu bar app, however <a href="http://www.bresink.com/osx/TemperatureMonitor.html">Temperature Monitor</a>, is also a good app if it is slightly more technical.</p>
<p>After you have opened your monitoring software we can now stress your CPU. Open Terminal. As a starter type the following into Terminal:</p>
<p><code>yes</code></p>
<p>You will notice, Terminal starts outputting the letter &#8216;y&#8217; and the CPU of your Mac increasing. The <a href="https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/yes.1.html">yes</a> command, will keep repeating this command indefinitely. To stop the process either press Control + C on your keyboard or close the Terminal window.</p>
<p>We can now use this command for each CPU (physical) core we have on your Mac. End the previous command, and type the following instead:</p>
<p><code>yes &gt; /dev/null</code></p>
<p>This will output the results of yes to a special location on your mac called <a href="http://en.wikipedia.org/wiki//dev/null">/dev/null</a> . This is done because opening up multiple instances of the yes command will not increase the load on your computer past 100%. However, when we pipe this command to /dev/null it will.</p>
<p>If you notice in Activity monitor your CPU load will increase to 100% of the yes command. This is fully loading one CPU core to its maximum. If you use something like iStat, you will notice the load is spread evenly between each cores, a feature of your operating system. To load the other cores, open up a new Terminal window, keeping the first one open, and repeat the command.</p>
<p>When you open two instances of the yes command being piped to /dev/null your load will increase to 200%, keep doing this for each core you have.</p>
<div id="attachment_1957" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mactricksandtips.com/wp-content/uploads/2012/02/mac-stress-test-cpu.png"><img class="size-medium wp-image-1957" title="mac stress test cpu" src="http://www.mactricksandtips.com/wp-content/uploads/2012/02/mac-stress-test-cpu-300x180.png" alt="" width="300" height="180" /></a><p class="wp-caption-text">Activity Monitor under heavy load.</p></div>
<p style="text-align: center;">
<p>One of the new features of the Intel cores is the ability to have <a href="http://en.wikipedia.org/wiki/Hyperthreading">hyper-threading</a>, as a result your Mac will report more cores than is physically present. This means if you have a quad core processor, your Mac will report eight cores. It allows your computer to run faster. However, in this stress test you will never be able to stress those extra four virtual cores. It doesn&#8217;t really matter, but means your CPU monitor will only fill half way, when in reality every core is running at full speed. It also means your the yes command can run at 100% (for each core) and other tasks can compute at the same time.</p>
<p>When you have finally finished stress testing your Mac, either close the Terminal window, of press Control + C. I let the command run for a couple of minutes and watched the CPU temperature slowly rise. If you think you have a problem with your CPU running at full speed, running this command and carrying out normal running of your Mac at the same time will help you eliminate any possible problems.</p>
<p>If you have any questions or comments, please leave one using the form below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/02/stress-test-your-mac-and-cpu.html">Stress Test Your Mac and CPU</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/04/test-the-disk-speed-of-your-hard-drives.html' rel='bookmark' title='Permanent Link: Test The Disk Speed Of Your Hard Drives'>Test The Disk Speed Of Your Hard Drives</a></li>
<li><a href='http://www.mactricksandtips.com/2011/01/find-files-in-use-using-activity-monitor.html' rel='bookmark' title='Permanent Link: Find Files In Use Using Activity Monitor'>Find Files In Use Using Activity Monitor</a></li>
<li><a href='http://www.mactricksandtips.com/2012/05/have-multiple-instances-of-vlc-or-quicktime-to-play-movies-or-music.html' rel='bookmark' title='Permanent Link: Have Multiple Instances Of VLC or QuickTime to Play Movies or Music'>Have Multiple Instances Of VLC or QuickTime to Play Movies or Music</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>View Terminal &#8216;man&#8217; Pages In Preview / PDF</title>
		<link>http://www.mactricksandtips.com/2012/01/view-terminal-man-pages-in-preview-pdf.html</link>
		<comments>http://www.mactricksandtips.com/2012/01/view-terminal-man-pages-in-preview-pdf.html#comments</comments>
		<pubDate>Mon, 30 Jan 2012 15:52:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1938</guid>
		<description><![CDATA[If you use Terminal regularly you may find yourself reading the 'man', pages frequently. These stand for manual and are the help guides for using the different commands. In Terminal if you type man command, where commands is replaced by the command you are using you can view the help guide. Quickly scrolling and viewing the data within the command can be a bit of a pain. For a very long command with many pages of help, it can be a little slow to view all of the information. To help us in this problem we can use a Terminal command to convert the man page to view in Preview. This is a lot more user friendly and allows you to use the resulting file like any pdf.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/01/view-terminal-man-pages-in-preview-pdf.html">View Terminal &#8216;man&#8217; Pages In Preview / PDF</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/07/view-terminal-help-pages-online.html' rel='bookmark' title='Permanent Link: View Terminal Help Pages Online'>View Terminal Help Pages Online</a></li>
<li><a href='http://www.mactricksandtips.com/2008/06/terminal-help-pages.html' rel='bookmark' title='Permanent Link: Terminal Help Pages'>Terminal Help Pages</a></li>
<li><a href='http://www.mactricksandtips.com/2008/10/joining-pdf-files-together-in-preview.html' rel='bookmark' title='Permanent Link: Joining PDF Files Together In Preview'>Joining PDF Files Together In Preview</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>If you use <a href="http://www.mactricksandtips.com/category/terminal">Terminal</a> regularly you may find yourself reading the &#8216;man&#8217;, pages frequently. These stand for manual and are the help guides for using the different commands. In Terminal if you type <code>man command</code>, where commands is replaced by the command you are using you can view the help guide. Quickly scrolling and viewing the data within the command can be a bit of a pain. For a very long command with many pages of help, it can be a little slow to view all of the information. To help us in this problem we can use a Terminal command to convert the man page to view in Preview. This is a lot more user friendly and allows you to use the resulting file like any pdf.</p>
<p>To view your man pages to one viewable in preview open up Terminal and type or paste in the following and hit enter. Replace xyz with the command you want to view the man page.<br />
<code><br />
man -t xyz | open -f -a /Applications/Preview.app</code></p>
<p>For example if we want to view the ssh man page in Preview we type the following:<br />
<code><br />
man -t ssh | open -f -a /Applications/Preview.app</code></p>
<p>Once Preview has done a bit of post processing you will be presented a 13-page pdf with the contents of the ssh man page. Due to the formatting involved with the man page, the resulting output is easy to read and well laid out. Simply save the file out using the Save As menu option, give it a useful name and you are all done.</p>
<div id="attachment_1939" class="wp-caption aligncenter" style="width: 307px"><a href="http://www.mactricksandtips.com/wp-content/uploads/2012/01/Terminal-man-page-in-preview.png"><img class="size-medium wp-image-1939" title="Terminal man page in preview" src="http://www.mactricksandtips.com/wp-content/uploads/2012/01/Terminal-man-page-in-preview-297x300.png" alt="" width="297" height="300" /></a><p class="wp-caption-text">A man page converted into a PDF document.</p></div>
<p style="text-align: center;">
<p>Try it yourself, I have been in the process of converting a lot my regularly used man pages in PDF&#8217;s. If you find you use this command regularly you can program it as a function Terminal can use. In Terminal type the following, assuming you have a freshly opened Terminal window in the default user path.</p>
<p><code>open .bash_profile</code></p>
<p>In the file that opens in TextEdit enter the following:</p>
<p><code>manpre () {<br />
man -t $@ | open -f -a /Applications/Preview.app<br />
}</code></p>
<p>You can change <code>manpre</code> to anything you want, something memorable. Save the file, close TextEdit and Quit and re-launch Terminal. Now every time you type the following into Terminal it will load the command you have just entered and convert the man page into a readable one in Preview.</p>
<p><code>manpre ssh</code></p>
<p>If you want to remove the command from Terminal, open up .bash_profile and delete the lines in the file.</p>
<p>Simple and clean. I prefer reading the PDF, Preview, versions of man pages over ones in Terminal as it is faster and I get the search function of Preview, very useful if I have a large man page and want to find something specific. If you have any questions or comments about this command, please leave one using the form below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/01/view-terminal-man-pages-in-preview-pdf.html">View Terminal &#8216;man&#8217; Pages In Preview / PDF</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/07/view-terminal-help-pages-online.html' rel='bookmark' title='Permanent Link: View Terminal Help Pages Online'>View Terminal Help Pages Online</a></li>
<li><a href='http://www.mactricksandtips.com/2008/06/terminal-help-pages.html' rel='bookmark' title='Permanent Link: Terminal Help Pages'>Terminal Help Pages</a></li>
<li><a href='http://www.mactricksandtips.com/2008/10/joining-pdf-files-together-in-preview.html' rel='bookmark' title='Permanent Link: Joining PDF Files Together In Preview'>Joining PDF Files Together In Preview</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Generate Random Numbers In Terminal/Bash</title>
		<link>http://www.mactricksandtips.com/2012/01/generate-random-numbers-in-terminalbash.html</link>
		<comments>http://www.mactricksandtips.com/2012/01/generate-random-numbers-in-terminalbash.html#comments</comments>
		<pubDate>Fri, 27 Jan 2012 19:07:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1933</guid>
		<description><![CDATA[I have a previously discussed about generating random numbers in applescript, today I am going to discuss two methods which you can use to generate random numbers in Terminal. This is useful for bash, terminal or any other scripts which use the language.  The two methods allow you to have a certain element of control on the size and the randomness and type of number produced. There are certain levels of randomness with random numbers produced by computers. One of the options shown will use an aspect of your Mac which is very random.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/01/generate-random-numbers-in-terminalbash.html">Generate Random Numbers In Terminal/Bash</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/02/generate-compare-md5-sha1-hashes-for-file-in-terminal.html' rel='bookmark' title='Permanent Link: Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal'>Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2008/10/customizing-the-mac-terminal-bash-prompt.html' rel='bookmark' title='Permanent Link: Customizing The Mac Terminal Bash Prompt'>Customizing The Mac Terminal Bash Prompt</a></li>
<li><a href='http://www.mactricksandtips.com/2008/03/apple-script-random-number-generator.html' rel='bookmark' title='Permanent Link: Apple Script Random Number Generator'>Apple Script Random Number Generator</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>I have a previously discussed about <a href="http://www.mactricksandtips.com/2008/03/apple-script-random-number-generator.html">generating random numbers in applescript</a>, today I am going to discuss two methods which you can use to generate random numbers in Terminal. This is useful for bash, terminal or any other scripts which use the language.  The two methods allow you to have a certain element of control on the size and the randomness and type of number produced. There are certain levels of <a href="http://www.random.org/randomness/">randomness</a> with random numbers produced by computers. One of the options shown will use an aspect of your Mac which is very random. If you don&#8217;t want the book versions of a <a href="http://www.amazon.com/gp/product/0833030477/ref=as_li_ss_tl?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0833030477">Million Random Digits</a>, using a computer is probably better.</p>
<h3>Option One</h3>
<p>This first options is rather simple, and great if you want a simple number for your script. Simply type the following into Terminal or your bash script, note that it has to be written in capitals:</p>
<p><code>echo $RANDOM</code></p>
<p>This will output a number up to 32,767, for those interested it is a <a href="http://en.wikipedia.org/wiki/Integer_%28computer_science%29">signed halfword</a> noted for being 16 bits in length. If you want to limit the random number up to a certain length simply type the following:</p>
<p><code>echo $[RANDOM%X+1]</code></p>
<p>Where X is your largest number you want, although it has to be less than 32,767. If you want a longer random number you can simply repeat the $RANDOM section of the command, such as the following:</p>
<p><code>echo $RANDOM$RANDOM</code></p>
<p>Using a combination of the previous two commands you can tailor the size of the number to anything you want. Although this method is simple and for most cases satisfactory I am unsure on the complete randomness of the number. The second command will have more randomness, although the first option is based on this command.</p>
<h3>Option Two</h3>
<p>This second command will use something called <a href="http://en.wikipedia.org/wiki//dev/urandom">/dev/urandom</a>, which is based on something called /dev/random. It takes noise in your system, such as mouse movements, network cards, hard drive access to name a few and output the random data to /dev/random and dev/urandom. We can then take the random 0&#8242;s and 1&#8242;s produced and convert them into a numerical number which we can use. This commands has slightly more control over the size and types of numbers which we produce.</p>
<p>The command to generate this random number is as follows:</p>
<p><code>od -vAn -N4 -tu &lt; /dev/urandom</code></p>
<p>This will generate a large number which you can use as your random number. There are two options which I would like to draw your attention to, although you can read about the <code>od</code> command, which is used to output the number on its <a href="http://compute.cnr.berkeley.edu/cgi-bin/man-cgi?od">man page</a>, the two options which are best changed is the number following the capital N, and the letter u between the t and 4 within the command options.</p>
<p>The -N options is used to control the size of the number in bytes, the number four will produce a ten digit number. If you increase the size of this number, eg to 5, it will split the outputted number into a 4 byte, 10 digit number and then into a one byte number. If you remove this option completely from the command, it will keep producing numbers.</p>
<p>The next option is to change the -tu4 to something different. You can change the letter u to either, d, o, or x. The letter d will produce a signed decimal to produce a value from − 2,147,483,648 to 2,147,483,647. The letter o will produce an octal value, where as u will produced an unsigned value of 0 to 4,294,967,295. Finally x will produce a hexadecimal value. For example:<br />
<code><br />
od -vAn -N4 -tx &lt; /dev/urandom</code></p>
<p>Produces the output, 05f70be9. Neat.</p>
<h3>Conclusion</h3>
<p>To conclude. The first option, is quick and easy. It allows you to generate a number and input them into a script will little thinking. The second option is more complex but allows you to have more control over the final output. Certainly more efficent than buying a <a href="http://www.amazon.com/gp/product/0833030477/ref=as_li_ss_tl?ie=UTF8&#038;tag=mact06-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0833030477">book with random numbers</a>.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/01/generate-random-numbers-in-terminalbash.html">Generate Random Numbers In Terminal/Bash</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/02/generate-compare-md5-sha1-hashes-for-file-in-terminal.html' rel='bookmark' title='Permanent Link: Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal'>Generate &#038; Compare MD5, SHA1 Hashes For Files In Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2008/10/customizing-the-mac-terminal-bash-prompt.html' rel='bookmark' title='Permanent Link: Customizing The Mac Terminal Bash Prompt'>Customizing The Mac Terminal Bash Prompt</a></li>
<li><a href='http://www.mactricksandtips.com/2008/03/apple-script-random-number-generator.html' rel='bookmark' title='Permanent Link: Apple Script Random Number Generator'>Apple Script Random Number Generator</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clear Terminal History</title>
		<link>http://www.mactricksandtips.com/2012/01/clear-terminal-history.html</link>
		<comments>http://www.mactricksandtips.com/2012/01/clear-terminal-history.html#comments</comments>
		<pubDate>Wed, 25 Jan 2012 16:56:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1929</guid>
		<description><![CDATA[This is a rather simple tip that will allow you to clear Terminal history either selectively or every entry within the terminals history file. When you type in Terminal history it will show you every single entry you have made. Previously I have mentioned how you can change the history size to suit, however if it is becoming rather large, or you want to remove entries that you do not want other people to access, such as a super secret location you don't want other people to find out about, it is worth removing entries.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/01/clear-terminal-history.html">Clear Terminal History</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/02/clear-or-bypass-web-browser-caches.html' rel='bookmark' title='Permanent Link: Clear or Bypass Your Web Browser Cache&#8217;s'>Clear or Bypass Your Web Browser Cache&#8217;s</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/opening-terminal-files-in-a-different-app.html' rel='bookmark' title='Permanent Link: Opening Terminal Files In A Different App'>Opening Terminal Files In A Different App</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/create-your-own-custom-terminal-commands.html' rel='bookmark' title='Permanent Link: Create Your Own Custom Terminal Commands'>Create Your Own Custom Terminal Commands</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>This is a rather simple tip that will allow you to clear Terminal history either selectively or every entry within the terminals history file. When you type in Terminal <code>history</code> it will show you every single entry you have made. <a href="http://www.mactricksandtips.com/2008/10/customizing-the-mac-terminal-bash-prompt.html">Previously</a> I have mentioned how you can change the history size to suit, however if it is becoming rather large, or you want to remove entries that you do not want other people to access, such as a super secret location you don&#8217;t want other people to find out about, it is worth removing entries.</p>
<p>To clear every entry in Terminals history type the following into the command prompt.</p>
<p><code>history -c</code></p>
<p>Within a blink of an eye, the history will be cleared, not that you cannot reverse this command so ensure you really want to clear you history. Now when you press the up button on your keyboard, no entries will be displayed.</p>
<p>If clearing the history is a bit to extreme, or there is just one entry you want to remove, such as an incorrect command from your list you do not want to repeat it is better to selectively remove the entry. This is done by modifying .bash_history. It is a hidden file located in your User directory that is accessed every time Terminal writes it&#8217;s history to disk. In a new Terminal prompt (to ensure you are at your User folder by default), type the following:</p>
<p><code>ls -a</code></p>
<p>This will show you all of the hidden files and folder. If you look through the list you should notice a file called .bash_history. To modify this file type the following:</p>
<p><code>nano .bash_history</code></p>
<p>You can now use the nano text editor to modify each line. If you don&#8217;t know how to use the nano text editor, the <a href="http://www.nano-editor.org/">nano editor homepage</a> is a good place to look, or you would rather use TextEdit, instead type the following into Terminal:</p>
<p><code>open .bash_history</code></p>
<p>This will open up TextEdit, now you can modify the file a lot quicker and easier. Delete the lines as you see fit. When you have finished simply save the file in TextEdit and restart the Terminal app to ensure the change has taken effect.</p>
<p>It is only a simple change but it can be useful if there is an incorrect command that you want to remove, I find I use the history to quickly select commands and it is always annoying when you have to scroll past incorrect commands. If you want to learn more about Mac Terminal commands, either look through the <a href="http://www.mactricksandtips.com/category/terminal">Terminal commands</a> section on this site or read a recommended <a href="http://www.amazon.com/gp/product/0470478365/ref=as_li_ss_tl?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0470478365">Terminal Book</a> from Amazon.</p>
<p>P.S Sorry for the long time between the last post, this last year was really busy and finding time to work on this site was a bit problematic.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2012/01/clear-terminal-history.html">Clear Terminal History</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2012/02/clear-or-bypass-web-browser-caches.html' rel='bookmark' title='Permanent Link: Clear or Bypass Your Web Browser Cache&#8217;s'>Clear or Bypass Your Web Browser Cache&#8217;s</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/opening-terminal-files-in-a-different-app.html' rel='bookmark' title='Permanent Link: Opening Terminal Files In A Different App'>Opening Terminal Files In A Different App</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/create-your-own-custom-terminal-commands.html' rel='bookmark' title='Permanent Link: Create Your Own Custom Terminal Commands'>Create Your Own Custom Terminal Commands</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Join avi Or Other Movie Files Together</title>
		<link>http://www.mactricksandtips.com/2011/01/join-avi-or-other-movie-files-together.html</link>
		<comments>http://www.mactricksandtips.com/2011/01/join-avi-or-other-movie-files-together.html#comments</comments>
		<pubDate>Wed, 05 Jan 2011 14:56:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1886</guid>
		<description><![CDATA[In this modern digital world we generate a lot of digital media, one of the most prevalent is movies. After a while I have a lot of indiviual movie files that could be better used as one long movie. This post aims to show you how to combine these movie files into one long movie. This isn't going to use an app like iMovie where you have to create a movie or apply any video editing. This post is going to show you how to stick lots of movies together in a simple and easy to use way. There is going to be two methods shown, one using Terminal and one with Quicktime, where you can pick the best option for yourself.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2011/01/join-avi-or-other-movie-files-together.html">Join avi Or Other Movie Files Together</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2009/07/converting-movie-files-quickly-and-easily.html' rel='bookmark' title='Permanent Link: Converting Movie Files Quickly And Easily'>Converting Movie Files Quickly And Easily</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/set-a-movie-as-a-wallpaper.html' rel='bookmark' title='Permanent Link: Set A Movie As A Wallpaper'>Set A Movie As A Wallpaper</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/make-quick-multi-file-files-w-terminal.html' rel='bookmark' title='Permanent Link: Make Quick Multi File Files w/ Terminal'>Make Quick Multi File Files w/ Terminal</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hello</p>
<p>In this modern digital world we generate a lot of digital media, one of the most prevalent is movies. After a while I have a lot of indiviual movie files that could be better used as one long movie. This post aims to show you how to combine these movie files into one long movie. This isn&#8217;t going to use an app like iMovie where you have to create a movie or apply any video editing. This post is going to show you how to stick lots of movies together in a simple and easy to use way. There is going to be two methods shown, one using Terminal and one with Quicktime, where you can pick the best option for yourself.</p>
<h3>Using Terminal</h3>
<p>The first method I am going to show you is to use a couple of Terminal commands. This is slightly more complicated however in the long run it will process your movie files quicker. This options takes the individual movie files, sticks them together and then sorts out the header section of the movie file so it will play correctly. The method using Quicktime will involve it re-encoding the files and can take a long time.</p>
<p>To begin with this method change directory to where you movie files are located. First open up Terminal located in Applications &gt; Utilites. Do this using the change directory command. You can either type the path out by hand or drop the folder into the Terminal window and press enter.</p>
<p><code>cd /path/to/seperate/video/files</code></p>
<p>We now need to stick the files together into one file. This process will take the second file, put the bytes on the end of the first file and repeat until it has gone through all of the files in the list. I like to think of it as putting a book together. You take your second book, spread glue on the cover and stick to the back of the first book. To do this in Terminal, we put out glue pot down, and use the cat, from the word&#8221;con<strong>cat</strong>enate&#8221; cocommand.<br />
<code><br />
cat video1.avi video2.avi videon.avi &gt; output.avi</code></p>
<p>The cat command will take videos 1 and 2 and stick them together, it will place them in the order in the list so don&#8217;t get them mixed up. You can add as many as you want to the list, it doesn&#8217;t have to be two items long however I would keep in mind that really long list of video files to stick together may cause some problems, so if you have hundreds of files it may be best to do this in bulk. When this has finished you will noticed to things. First the file size of output.avi is the same as the sum of video1 and video2. Second, when you play the avi file it will only play the length to the length of the first video. This is beacause the header section of the first avi only knows its original length. Going back to our book analogy the contents page of the first book, only knows the contents of the first book and not the second. What we now need to do is rebuild the header file so it knows about the second video (or second book contents). This will make sure when it plays it plays all of the video and not just the first part.</p>
<p>To do this we are going to use a program called <a href="http://en.wikipedia.org/wiki/MEncoder">mencoder</a>. Its from a site called <a href="http://www.mplayerhq.hu/">mplayerhq</a>, however we only need the binary for Terminal. To do this head over to <a href="http://stefpause.com/apple/mac/mplayer-os-x-10rc1-and-mencoder-binaries/">stefpause</a> and download the mencoder bianry located at the bottom of the page. When you have downloaded the binary move it using the following command.<br />
<code><br />
sudo mv /path/to/mencoder /usr/local/bin</code></p>
<p>Terminal will ask for your admin password. This is done so you only have to write &#8220;mencoder&#8221; in Terminal and not the path to the mencoder file. More information on install this app can be found <a href="http://snippets.aktagon.com/snippets/132-How-to-install-ffmpeg-mencoder-and-flvtool2-on-Mac-OSX-Leopard-convert-an-AVI-to-FLV-and-view-the-FLV-video-with-FlowPlayer">here</a>.</p>
<p>Now that we have mencoder installed we can use it rebuild the header of our avi file. To do this write or copy and paste the following into Terminal. The command assumes you are in the same location as the file output.avi created earlier.</p>
<p><code>mencoder -forceidx -oac copy -ovc copy output.avi -o output_final.avi;</code></p>
<p>In a nutshell this commands rebuilds the header file. One unqiue point about this commands is that it only copies the frames and audio across, it doesn&#8217;t re-encode them. This saves a lot of time in building the final file. Most of the time you don&#8217;t need to re-encode anything. If you want more of an understanding of mencoder you can read the <a href="http://www1.mplayerhq.hu/MPlayer/DOCS/HTML/en/mencoder.html">basic help</a>.</p>
<p>When the command has finished, which shouldn&#8217;t take to long you should now have a working avi file which is the correct lenght and contains all of the previous videos.</p>
<p>To summarise the commands are:</p>
<p><code>cat video1.avi video2.avi videon.avi &gt; output.avi<br />
mencoder -forceidx -oac copy -ovc copy output.avi -o output_final.avi;<br />
rm output.avi</code></p>
<p>The last line removes the incorrect output file from the cat command. There you have it a video made from the sum of the smaller parts. Once you understand what is happening this command is very fast and very useful.</p>
<p>If you want to learn more about cat and other unix commands I recommend <a href="http://www.amazon.com/gp/product/0470478365?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0470478365">Mac OS X Toolbox</a>, if you want to learn more about mencoder amazon has thrown <a href="http://www.amazon.com/gp/product/6131980470?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=6131980470">this book</a> up, although I am dubious to it content.</p>
<h3>Using Quicktime</h3>
<p>If you are not very confident in using Terminal and want more more application based method, Quicktime Player 7, located in Applications &gt; Utilites in Mac OS X 10.6,  has an option to do this sort of thing. The only downside is that you don&#8217;t have much control on the final video specs. I have found that it does a bit of re-encoding as well as converting the file from avi to mov. However if all you want to do is stick some movies together this method it very simple.</p>
<p>To begin with open up Quicktime located in the Utilites folder. Then open up your first movie. Move the scrubber to the far right as shown in the image below.</p>
<div id="attachment_1887" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mactricksandtips.com/wp-content/uploads/2011/01/quicktime-scrubber.png"><img class="size-medium wp-image-1887" title="quicktime scrubber" src="http://www.mactricksandtips.com/wp-content/uploads/2011/01/quicktime-scrubber-300x38.png" alt="" width="300" height="38" /></a><p class="wp-caption-text">Editing movies with Quicktime is simple and easy.</p></div>
<p style="text-align: center;">
<p>Then drag and drop your second movie onto Quicktime, move the scrubber the far right and repeat.</p>
<p>When you have finished compling your movie go to File &gt; Save As and select self-contained movie. The app will compile your movie and spit it out.</p>
<p>If you want to learn more about Quicktime something like <a href="http://www.amazon.com/gp/product/0240804961?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0240804961">QuickTime for Filmmakers</a> is very well rated.</p>
<h3>Conclusion</h3>
<p>In total these are two of many methods where you can combine movie files together. I prefer the Terminal method since it is quicker, however the Quicktime method may be more useful and easier to remember if you don&#8217;t use Terminal that frequently.</p>
<p>If you have any questions or comments about this trick please leave them below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2011/01/join-avi-or-other-movie-files-together.html">Join avi Or Other Movie Files Together</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2009/07/converting-movie-files-quickly-and-easily.html' rel='bookmark' title='Permanent Link: Converting Movie Files Quickly And Easily'>Converting Movie Files Quickly And Easily</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/set-a-movie-as-a-wallpaper.html' rel='bookmark' title='Permanent Link: Set A Movie As A Wallpaper'>Set A Movie As A Wallpaper</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/make-quick-multi-file-files-w-terminal.html' rel='bookmark' title='Permanent Link: Make Quick Multi File Files w/ Terminal'>Make Quick Multi File Files w/ Terminal</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Stop A Stuck Time Machine Backup</title>
		<link>http://www.mactricksandtips.com/2010/12/stop-a-stuck-time-machine-backup.html</link>
		<comments>http://www.mactricksandtips.com/2010/12/stop-a-stuck-time-machine-backup.html#comments</comments>
		<pubDate>Wed, 22 Dec 2010 18:19:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1873</guid>
		<description><![CDATA[I love Time Machine. Its a simple way to keep all your files backed up and my Time Capsule is slowly filling up with data. I have, however, come across a problem here the back up process itself does get stuck. This recently happened to a friend and in short of restarting or pulling out the cable I wanted to find a more graceful method. I've found two ways to stop a stuck time machine backup.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/12/stop-a-stuck-time-machine-backup.html">Stop A Stuck Time Machine Backup</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/02/increasing-time-machine-backup-interval.html' rel='bookmark' title='Permanent Link: Increasing Time Machine Backup Interval'>Increasing Time Machine Backup Interval</a></li>
<li><a href='http://www.mactricksandtips.com/2009/09/backup-solutions-for-the-mac.html' rel='bookmark' title='Permanent Link: Backup Solutions For The Mac'>Backup Solutions For The Mac</a></li>
<li><a href='http://www.mactricksandtips.com/2009/07/using-time-machine-13-noob2pro.html' rel='bookmark' title='Permanent Link: Using Time Machine &#8211; #13 Noob2Pro'>Using Time Machine &#8211; #13 Noob2Pro</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>I love <a href="http://www.apple.com/macosx/what-is-macosx/time-machine.html">Time Machine</a>. Its a simple way to keep all your files backed up and my <a href="http://www.amazon.com/gp/product/B002TLTGJ4?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B002TLTGJ4">Time Capsule</a> is slowly filling up with data. I have, however, come across a problem here the back up process itself does get stuck. This recently happened to a friend and in short of restarting or pulling out the cable I wanted to find a more graceful method. I&#8217;ve found two ways to stop a stuck time machine backup.</p>
<p>The first command which you write in Terminal (Applications &gt; Utilities) is</p>
<p><code>sudo service com.apple.metadata.mds stop<br />
</code><br />
and if you want to restart the service (which you do),<br />
<code><br />
sudo service com.apple.metadata.mds start</code></p>
<p>This is known to work in 10.5. If however these two commands don&#8217;t work, which may be prevalent in the latest operating systems you can try.</p>
<p><code>sudo launchctl stop /System/Library/LaunchDaemons/com.apple.metadata.mds.plist<br />
sudo launchctl start /System/Library/LaunchDaemons/com.apple.metadata.mds.plist</code></p>
<p>Again written in Terminal. The latter is probably best if you are using Mac OS X 10.6</p>
<p>Hopefully this will solve any stuck time machine backups. I haven&#8217;t yet experienced such a problem, I am however assured that these two methods do work.</p>
<p>If you want more general tips and tricks I recommend <a href="http://www.amazon.com/gp/product/059652952X?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=059652952X">The Missing Manual</a> or <a href="http://www.amazon.com/gp/product/0470878681?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0470878681">Macs For Dummies</a>. In the mean time I am going to watch <a href="http://www.amazon.com/gp/product/B00005JKLZ?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00005JKLZ">The Time Machine</a> since I have time travel related problems whizzing round my head.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/12/stop-a-stuck-time-machine-backup.html">Stop A Stuck Time Machine Backup</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/02/increasing-time-machine-backup-interval.html' rel='bookmark' title='Permanent Link: Increasing Time Machine Backup Interval'>Increasing Time Machine Backup Interval</a></li>
<li><a href='http://www.mactricksandtips.com/2009/09/backup-solutions-for-the-mac.html' rel='bookmark' title='Permanent Link: Backup Solutions For The Mac'>Backup Solutions For The Mac</a></li>
<li><a href='http://www.mactricksandtips.com/2009/07/using-time-machine-13-noob2pro.html' rel='bookmark' title='Permanent Link: Using Time Machine &#8211; #13 Noob2Pro'>Using Time Machine &#8211; #13 Noob2Pro</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install Apple Updates From Terminal</title>
		<link>http://www.mactricksandtips.com/2010/12/install-apple-updates-from-terminal.html</link>
		<comments>http://www.mactricksandtips.com/2010/12/install-apple-updates-from-terminal.html#comments</comments>
		<pubDate>Mon, 20 Dec 2010 20:43:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1865</guid>
		<description><![CDATA[Sorry its been a long time since the last post, so I am going to start with an interesting one. I quite enjoying digging out and finding new command line updates to run and use. Today's command line post will allow you to download and install software updates from Terminal or the command line. Its great for those scripts you may be building and want to add that extra functionality to them.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/12/install-apple-updates-from-terminal.html">Install Apple Updates From Terminal</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/08/five-quick-terminal-tips.html' rel='bookmark' title='Permanent Link: Five Quick Terminal Tips'>Five Quick Terminal Tips</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/installing-wget-on-your-mac-for-terminal.html' rel='bookmark' title='Permanent Link: Installing wget On Your Mac For Terminal'>Installing wget On Your Mac For Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2008/09/delete-problem-files-with-terminal.html' rel='bookmark' title='Permanent Link: Delete Problem Files With Terminal'>Delete Problem Files With Terminal</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hello Again,</p>
<p>Sorry its been a long time since the last post, so I am going to start with an interesting one. I quite enjoying digging out and finding new command line updates to run and use. Today&#8217;s command line post will allow you to download and install software updates from Terminal or the command line. Its great for those scripts you may be building and want to add that extra functionality to them.</p>
<p>To run this command line, first open up Terminal from Applications &gt; Utilities. Within Terminal type the following:</p>
<p><code>sudo softwareupdate -i -v -a</code></p>
<p>This script will run and do the following: First it will invoke the software update tool, it will then install any available updates using the -i modifier, it will also install all of them using the -a modifier. Finally the -v modifier will tell you what is happening. In short, look, download, install.</p>
<p>If you want to use this tool but you don&#8217;t want to install anything. You can let the tool list any downloads available to you. To do this type the following:<br />
<code><br />
sudo softwareupdate -l</code></p>
<p>The, -l, modifier will list any updates. It may take a while for anything to appear, its best to let it run. You will get something similar to the image below if any updates are available.</p>
<p><a href="http://www.mactricksandtips.com/wp-content/uploads/2010/12/terminal-software-update.png"><img class="aligncenter size-medium wp-image-1866" title="terminal software update" src="http://www.mactricksandtips.com/wp-content/uploads/2010/12/terminal-software-update-300x107.png" alt="" width="300" height="107" /></a></p>
<p>A simple and useful command, that is quite interesting. If you want more information on this tool, type the following into Terminal.</p>
<p><code>man softwareupdate</code></p>
<p>If you want more information on Terminal or the Mac OS in general I recommend you check out <a href="http://www.amazon.com/gp/product/0596153287?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596153287">Mac OS X: The Missing Manual</a> or <a href="http://www.amazon.com/gp/product/0470478365?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0470478365">Mac OS X Unix Toolbox</a>.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/12/install-apple-updates-from-terminal.html">Install Apple Updates From Terminal</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/08/five-quick-terminal-tips.html' rel='bookmark' title='Permanent Link: Five Quick Terminal Tips'>Five Quick Terminal Tips</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/installing-wget-on-your-mac-for-terminal.html' rel='bookmark' title='Permanent Link: Installing wget On Your Mac For Terminal'>Installing wget On Your Mac For Terminal</a></li>
<li><a href='http://www.mactricksandtips.com/2008/09/delete-problem-files-with-terminal.html' rel='bookmark' title='Permanent Link: Delete Problem Files With Terminal'>Delete Problem Files With Terminal</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Open Your Current Terminal Directory In Finder</title>
		<link>http://www.mactricksandtips.com/2010/08/open-your-current-terminal-directory-in-finder.html</link>
		<comments>http://www.mactricksandtips.com/2010/08/open-your-current-terminal-directory-in-finder.html#comments</comments>
		<pubDate>Tue, 17 Aug 2010 20:12:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1833</guid>
		<description><![CDATA[I found a rather cool little tip that I thought I would post. Its in regards to opening the current folder you are browsing in while using Terminal. Many times I have wondered if there was a way to view my current folder, this is usually very useful if you are very deep within a directory and need to have a more visual look at it with Finder. I've also found that its useful when viewing the output of any bash scripts.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/08/open-your-current-terminal-directory-in-finder.html">Open Your Current Terminal Directory In Finder</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/08/close-all-but-the-current-finder-window.html' rel='bookmark' title='Permanent Link: Close All But The Current Finder Window'>Close All But The Current Finder Window</a></li>
<li><a href='http://www.mactricksandtips.com/2008/11/open-terminal-output-directly-in-textedit.html' rel='bookmark' title='Permanent Link: Open Terminal Output Directly In TextEdit'>Open Terminal Output Directly In TextEdit</a></li>
<li><a href='http://www.mactricksandtips.com/2008/03/moving-around-in-finder.html' rel='bookmark' title='Permanent Link: Moving Around In Finder'>Moving Around In Finder</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>I found a rather cool little tip that I thought I would post. Its in regards to opening the current folder you are browsing in while using Terminal. Many times I have wondered if there was a way to view my current folder, this is usually very useful if you are very deep within a directory and need to have a more visual look at it with Finder. I&#8217;ve also found that its useful when viewing the output of any bash scripts.</p>
<p>To open the folder you are viewing in Terminal type the following:</p>
<p><code>open .</code></p>
<p>The word &#8220;open&#8221; is followed with a dot, without it it doesn&#8217;t work.</p>
<p>You can combine the open command with the change directory command. This is useful if you want to do something in Terminal and view the Finder window belonging to it.</p>
<p><code>cd /path/to/folder; open .</code></p>
<p>You can write it as one line and is a quick way to move around Terminal and Finder in one.</p>
<p>Within a couple of days i&#8217;ll have another post on using the open command. It is very useful.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/08/open-your-current-terminal-directory-in-finder.html">Open Your Current Terminal Directory In Finder</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/08/close-all-but-the-current-finder-window.html' rel='bookmark' title='Permanent Link: Close All But The Current Finder Window'>Close All But The Current Finder Window</a></li>
<li><a href='http://www.mactricksandtips.com/2008/11/open-terminal-output-directly-in-textedit.html' rel='bookmark' title='Permanent Link: Open Terminal Output Directly In TextEdit'>Open Terminal Output Directly In TextEdit</a></li>
<li><a href='http://www.mactricksandtips.com/2008/03/moving-around-in-finder.html' rel='bookmark' title='Permanent Link: Moving Around In Finder'>Moving Around In Finder</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Use Terminal To Measure Wi-Fi Strength</title>
		<link>http://www.mactricksandtips.com/2010/06/use-terminal-to-measure-wi-fi-strength.html</link>
		<comments>http://www.mactricksandtips.com/2010/06/use-terminal-to-measure-wi-fi-strength.html#comments</comments>
		<pubDate>Mon, 28 Jun 2010 19:31:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1776</guid>
		<description><![CDATA[There is a lot of power available in Terminal, and if used correctly you can create some really interesting scripts and result. Today's post is going to take advantage of some built in Airport frameworks to measure the strength of your connected Wi-Fi signal. Although you can download and use various different apps to do this, if you want a quick way measure the signal, to find the best place to put your laptop, or integrate into something like GeekTool. A quick Terminal script is what you need.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/06/use-terminal-to-measure-wi-fi-strength.html">Use Terminal To Measure Wi-Fi Strength</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/08/five-quick-terminal-tips.html' rel='bookmark' title='Permanent Link: Five Quick Terminal Tips'>Five Quick Terminal Tips</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/view-terminal-help-pages-online.html' rel='bookmark' title='Permanent Link: View Terminal Help Pages Online'>View Terminal Help Pages Online</a></li>
<li><a href='http://www.mactricksandtips.com/2008/10/start-time-machine-backups-from-terminal.html' rel='bookmark' title='Permanent Link: Start Time Machine Backups From Terminal'>Start Time Machine Backups From Terminal</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Good Evening,</p>
<p>There is a lot of power available in Terminal, and if used correctly you can create some really interesting scripts and result. Today&#8217;s post is going to take advantage of some built in Airport frameworks to measure the strength of your connected Wi-Fi signal. Although you can download and use various different apps to do this, if you want a quick way measure the signal, to find the best place to put your laptop, or integrate into something like <a href="http://projects.tynsoe.org/en/geektool/">GeekTool</a>. A quick Terminal script is what you need.</p>
<p>Your make is built up on various frameworks, essentially build in blocks. Within these building blocks your Mac has all of the usual features you see and use. However select frameworks allow you to extract certain bits of information. This is exactly what we are going to do, to measure signal strength. To do this open Terminal and type the following.</p>
<p><code>/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I</code></p>
<p>You have to be connected to a Wireless signal. The output will look similar to the following:</p>
<p><code>agrCtlRSSI: -69<br />
agrExtRSSI: 0<br />
agrCtlNoise: -96<br />
agrExtNoise: 0<br />
state: running<br />
op mode: station<br />
lastTxRate: 48<br />
maxRate: 54<br />
lastAssocStatus: 0<br />
802.11 auth: open<br />
link auth: none<br />
BSSID: 0:11:11:11:11:11<br />
SSID: DLINK_WIRELESS<br />
MCS: -1<br />
channel: 6</code></p>
<p>Most of the data is self explanatory. &#8216;agrCtlRSSI&#8217; is the signal strength, we will want to get this as high as possible. This is the value we will use later on, &#8216;agrCtlNoise&#8217; is the noise on your Wi-Fi signal you want this as low as possible. Finally, &#8216;maxRate&#8217; is the maximum rate at which your Wi-Fi signal can run at, and &#8216;lastTxRate&#8217; is the last transmitted rate. These two values will probably not change.</p>
<p>If you are interested you can also use this Terminal command to scan the airwaves for other Wi-Fi signals to connect to.</p>
<p><code>/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s</code></p>
<h4>A Live Scanner</h4>
<p>At the moment, using the first command to find the best signal is a bit bulky. The amount of information returned is too much. By placing it into a little loop and picking the right bit of information, it will return just the signal strength. As a result the information returned can easily be used to pick the right spot for your laptop. You simply walk around with your laptop and watch as the signal will rise and fall. [via <a rel="nofollow" href="http://www.macosxhints.com/article.php?story=20100405162603767">macosxhints</a>]<br />
<code><br />
while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI; sleep 0.5; done</code></p>
<p>This little script will query the Airport as previously mentioned and pull out the signal strength part. Every half a second it will repeat. The results will look something like the following:</p>
<p><code>agrCtlRSSI: -69<br />
agrCtlRSSI: -69<br />
agrCtlRSSI: -70<br />
agrCtlRSSI: -71</code></p>
<p>If you want the list to populate quicker, change 0.5 to something smaller. If you want a longer pause between the lines updating put in a higher value. To stop the output press Control + C and you be returned to the command line. If you want to view the noise associated with the Wi-Fi signal, type the following:<br />
<code><br />
while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlNoise; sleep 0.1; done</code></p>
<p>Very useful and very interesting. If you want to use the command line in a different bash script or in something like GeekTool you only need to type the following.</p>
<p><code>/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport  -I | grep CtlRSSI</code></p>
<p>There you go. Have a play around and see where to place your laptop for the best Wi-Fi result. Its a simple command but very useful. If you have any comments or tips relating to this command please let me know in the comments. If you are interested in reading more about Wi-Fi I recommend <a href="http://www.amazon.com/gp/product/1593271697?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1593271697">The Book of Wireless</a> from Amazon.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/06/use-terminal-to-measure-wi-fi-strength.html">Use Terminal To Measure Wi-Fi Strength</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2008/08/five-quick-terminal-tips.html' rel='bookmark' title='Permanent Link: Five Quick Terminal Tips'>Five Quick Terminal Tips</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/view-terminal-help-pages-online.html' rel='bookmark' title='Permanent Link: View Terminal Help Pages Online'>View Terminal Help Pages Online</a></li>
<li><a href='http://www.mactricksandtips.com/2008/10/start-time-machine-backups-from-terminal.html' rel='bookmark' title='Permanent Link: Start Time Machine Backups From Terminal'>Start Time Machine Backups From Terminal</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Cheat At Scrabble (With Terminal)</title>
		<link>http://www.mactricksandtips.com/2010/06/how-to-cheat-at-scrabble-with-terminal.html</link>
		<comments>http://www.mactricksandtips.com/2010/06/how-to-cheat-at-scrabble-with-terminal.html#comments</comments>
		<pubDate>Sun, 27 Jun 2010 12:56:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1774</guid>
		<description><![CDATA[I enjoy a good board game every so often, they are even more fun when you can play them online or as a standalone game. The one game, however, that I can never really play is Scrabble. Simply because I can't figure out words from the 7 tiles given to you. The best I can do is five letter words, swear words and adding the occasional 's' or 'ed' to the end of the words. What I need is a way to cheat, or at least give me a helping hand. As the title of this post suggests there is a very simple and effective way to do this using some commands and files built into Terminal.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/06/how-to-cheat-at-scrabble-with-terminal.html">How To Cheat At Scrabble (With Terminal)</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2009/06/mac-cheat-sheet.html' rel='bookmark' title='Permanent Link: Mac Cheat Sheet'>Mac Cheat Sheet</a></li>
<li><a href='http://www.mactricksandtips.com/2009/06/create-a-crossword-solver.html' rel='bookmark' title='Permanent Link: Create A Crossword Solver'>Create A Crossword Solver</a></li>
<li><a href='http://www.mactricksandtips.com/2009/08/cheat-sheets-finding-shortcuts-noob2pro-26.html' rel='bookmark' title='Permanent Link: Cheat Sheets, Finding Shortcuts &#8211; Noob2Pro #26'>Cheat Sheets, Finding Shortcuts &#8211; Noob2Pro #26</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>I enjoy a good board game every so often, they are even more fun when you can play them online or as a standalone game. The one game, however, that I can never really play is <a href="http://www.amazon.com/gp/product/B00000IWDB?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B00000IWDB">Scrabble</a>. Simply because I can&#8217;t figure out words from the 7 tiles given to you. The best I can do is five letter words, swear words and adding the occasional &#8216;s&#8217; or &#8216;ed&#8217; to the end of the words. What I need is a way to cheat, or at least give me a helping hand. As the title of this post suggests there is a very simple and effective way to do this using some commands and files built into Terminal.</p>
<p>The simplest way to cheat at scrabble is to use a word list with plenty of words and then query that list to look for words containing certain letters. There are many ways you can do this and you may develop your own solution, the method I have found is to use a Terminal command called &#8216;grep&#8217; which finds lines containing a pattern, exactly what we need.</p>
<p>To use this command open Terminal and type the following:</p>
<p><code>cd /usr/share/dict<br />
</code><br />
This will change the directory of your current Terminal session. What has been opened is the location of a built in list of words, i&#8217;ve mentioned it before <a href="http://www.mactricksandtips.com/2008/07/location-of-your-words-file.html">here</a>. This list is very long and contains thousands of entries. Although some entries wont be suitable words in Scrabble, it&#8217;s a good place to start. If you have a better list of words (such as one downloaded from the internet) you can use the &#8216;cd&#8217; command and change it to that directory.</p>
<p>To search this list type the following:</p>
<p><code>grep -x '[ahegilk]*' web2</code></p>
<p>This command uses the grep program to search through the words file called &#8216;web2&#8242;. The option, -x, makes sure it only matches words which contain the letters within the square brackets. The letters within the square brackets will be searched and found within the words list. The better  your words list, the more words you can find, the words list built into your Mac is sufficient, for most words and games. Simply replace the letters in the square brackets with the ones you currently have.</p>
<p>Its worth noting at this point that the star at the end of the square brackets will try and match the letters zero or more times. As a result you may get results where the same letter is repeated multiple times, but you only have one letter to use. You could get round this problem by replacing the star with a question mark, an only allow the letters to appear once. However this doesn&#8217;t seem to work on my Mac.</p>
<p>Having a list of words is fine, however in Scrabble you have to add the words onto the board, you need to control how the word starts or ends. This is very simple. To make sure the list only finds words that begin with certain letters, type the following:</p>
<p><code>grep -x '^be[ahegilk]*' web2</code></p>
<p>This will find words that contain the letters &#8216;a h e g i l k&#8217; but begins with &#8216;be&#8217;. The letters at the beginning can be any length, however one or two letters yeild the best results.</p>
<p>You can also search for words that end with certain letters. This, again, is simple. Simply type the following:</p>
<p><code>grep -x '[ahegilk]*ed$' web2</code></p>
<p>This will find all the words that end with &#8216;ed&#8217;. Its worth noting that depending on your words file this will yield different results. I know that the words file built into your Mac, that we are using, doesn&#8217;t have many words ending in &#8216;s&#8217; or &#8216;ed&#8217;, so it isn&#8217;t that useful. If you have found a bumper words file you may have better luck.</p>
<p>You can combine both commands so you can find words that start and end with a certain letter.</p>
<p><code>grep -x '^h[ahegilk]*ed$' web2</code></p>
<p>Very simple and quite useful if you are stuck for words. It does have some limitations such as a limited words file, or repeated letters, but its a simple and quick way to find some words if you are stuck.</p>
<p>If you have found any ways to improve this script, please let me know. I would like to see how this script can evolve and change. With a bit of work it shouldn&#8217;t take too long to make a command to find some really long and high scoring words. It may be cheating, but I still end up losing.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/06/how-to-cheat-at-scrabble-with-terminal.html">How To Cheat At Scrabble (With Terminal)</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2009/06/mac-cheat-sheet.html' rel='bookmark' title='Permanent Link: Mac Cheat Sheet'>Mac Cheat Sheet</a></li>
<li><a href='http://www.mactricksandtips.com/2009/06/create-a-crossword-solver.html' rel='bookmark' title='Permanent Link: Create A Crossword Solver'>Create A Crossword Solver</a></li>
<li><a href='http://www.mactricksandtips.com/2009/08/cheat-sheets-finding-shortcuts-noob2pro-26.html' rel='bookmark' title='Permanent Link: Cheat Sheets, Finding Shortcuts &#8211; Noob2Pro #26'>Cheat Sheets, Finding Shortcuts &#8211; Noob2Pro #26</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting Files In Terminal (Including Docx)</title>
		<link>http://www.mactricksandtips.com/2010/06/converting-files-in-terminal-including-docx.html</link>
		<comments>http://www.mactricksandtips.com/2010/06/converting-files-in-terminal-including-docx.html#comments</comments>
		<pubDate>Sat, 26 Jun 2010 10:21:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1772</guid>
		<description><![CDATA[Quite a while ago I mentioned how you can convert Windows Docx  files to Doc using a little app supplied by Microsoft themselves, its a simple way of saving money and not having to fork out for Office for Mac. That app is great for one or two files that you want to convert, however if you have hundreds of files or want to build this functionality into a bash script it can be a little bit difficult. However there is a suitable Terminal program that you can use. This script piggy backs on the functionality built into TextEdit, so any results you get from TextEdit you will see in this Terminal program.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/06/converting-files-in-terminal-including-docx.html">Converting Files In Terminal (Including Docx)</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2010/01/converting-windows-docx-files-to-doc.html' rel='bookmark' title='Permanent Link: Converting Windows Docx Files To Doc'>Converting Windows Docx Files To Doc</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/opening-terminal-files-in-a-different-app.html' rel='bookmark' title='Permanent Link: Opening Terminal Files In A Different App'>Opening Terminal Files In A Different App</a></li>
<li><a href='http://www.mactricksandtips.com/2009/07/converting-movie-files-quickly-and-easily.html' rel='bookmark' title='Permanent Link: Converting Movie Files Quickly And Easily'>Converting Movie Files Quickly And Easily</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Good Morning,</p>
<p>Quite a while ago I mentioned how you can convert <a href="http://www.mactricksandtips.com/2010/01/converting-windows-docx-files-to-doc.html">Windows Docx files to Doc</a> using a little app supplied by Microsoft themselves, its a simple way of saving money and not having to fork out for <a href="http://www.amazon.com/gp/product/B000X86ZAS?ie=UTF8&amp;tag=mact06-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=B000X86ZAS">Office for Mac</a>. That app is great for one or two files that you want to convert, however if you have hundreds of files or want to build this functionality into a bash script it can be a little bit difficult. However there is a suitable Terminal program that you can use. This script piggy backs on the functionality built into TextEdit, so any results you get from TextEdit you will see in this Terminal program.</p>
<p>The function we are going to use is textutil. As you may guess by the name it is a text utility. The program has many functions and you can find out how to use them all by reading the man page (in Terminal type &#8216;man textutil&#8217;), i&#8217;m going to focus, however, on the conversion aspect of the program. In this example I am going to convert a docx file to a doc file. In total you can use any of these format txt, rtf, rtfd, html, doc, docx, odt, wordml, or webarchive.</p>
<p>To convert a file type the following in Terminal:</p>
<p><code>textutil -convert doc /path/to/my/file.docx</code></p>
<p>This will convert the file from docx to doc. The result will be exactly the same if you used TextEdit to open the file and save it out. For example i&#8217;ve found any docx images won&#8217;t appear in the final doc format, if you want the images its better to use the little app supplied by Microsoft. Simply change &#8216;doc&#8217; into the format you are looking for. If you don&#8217;t think it will work, try the file extension and see what happens.</p>
<p>If you want to convert all of the files in a folder to one format you can type<br />
<code><br />
textutil -convert doc /path/to/location/*.docx</code></p>
<p>This will convert every file in the folder with .docx as the the file type into the doc format. This is a very quick way of converting lots of files.</p>
<p>There is a lot of power with this tool. If you want to learn more about the program, use the man page as mentioned, if you have a cool little tip about this function please leave a comment below.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/06/converting-files-in-terminal-including-docx.html">Converting Files In Terminal (Including Docx)</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2010/01/converting-windows-docx-files-to-doc.html' rel='bookmark' title='Permanent Link: Converting Windows Docx Files To Doc'>Converting Windows Docx Files To Doc</a></li>
<li><a href='http://www.mactricksandtips.com/2010/04/opening-terminal-files-in-a-different-app.html' rel='bookmark' title='Permanent Link: Opening Terminal Files In A Different App'>Opening Terminal Files In A Different App</a></li>
<li><a href='http://www.mactricksandtips.com/2009/07/converting-movie-files-quickly-and-easily.html' rel='bookmark' title='Permanent Link: Converting Movie Files Quickly And Easily'>Converting Movie Files Quickly And Easily</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hide Select Icons From View (incl Hard Drives)</title>
		<link>http://www.mactricksandtips.com/2010/06/hide-select-icons-from-view-incl-hard-drives.html</link>
		<comments>http://www.mactricksandtips.com/2010/06/hide-select-icons-from-view-incl-hard-drives.html#comments</comments>
		<pubDate>Wed, 23 Jun 2010 18:00:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://www.mactricksandtips.com/?p=1763</guid>
		<description><![CDATA[Continuing from a post a couple of days ago about Hiding Hard Drive Icons From Your Desktop and reading into an insight full comment i've found a method where you can hide certain hard drive, folders and files from view. A quick method is to normally add a dot in front of the file name so it becomes a "dot-file" for example ".hiddenfile.txt". This will make the file disappear from view. However this changes the file name and if you have any scripts or applications that rely on the exact file name this can be a problem, it can be even worst when you want to remove a Hard Drive, change the file name of such a volume can be disastrous. Therefore we are going to play around with a couple of Terminal programs to change the attributes of files, folders and even Hard Drives so we can hide them from view.<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/06/hide-select-icons-from-view-incl-hard-drives.html">Hide Select Icons From View (incl Hard Drives)</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>



Related posts:<ol><li><a href='http://www.mactricksandtips.com/2010/01/solving-minor-problems-incl-crashes-in-apps.html' rel='bookmark' title='Permanent Link: Solving Minor Problems (incl Crashes) In Apps'>Solving Minor Problems (incl Crashes) In Apps</a></li>
<li><a href='http://www.mactricksandtips.com/2009/07/hide-the-menubar-or-dock-in-specific-apps.html' rel='bookmark' title='Permanent Link: Hide The MenuBar or Dock In Specific Apps'>Hide The MenuBar or Dock In Specific Apps</a></li>
<li><a href='http://www.mactricksandtips.com/2008/10/hide-a-programs-dock-icon-while-it-is-running.html' rel='bookmark' title='Permanent Link: Hide A Programs Dock Icon'>Hide A Programs Dock Icon</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>Continuing from a post a couple of days ago about <a href="http://www.mactricksandtips.com/2010/06/hiding-hard-drive-icons-from-your-desktop.html">Hiding Hard Drive Icons From Your Desktop</a> and reading into an insight full comment i&#8217;ve found a method where you can hide certain hard drive, folders and files from view. A quick method is to normally add a dot in front of the file name so it becomes a &#8220;dot-file&#8221; for example &#8220;.hiddenfile.txt&#8221;. This will make the file disappear from view. However this changes the file name and if you have any scripts or applications that rely on the exact file name this can be a problem, it can be even worst when you want to remove a Hard Drive, change the file name of such a volume can be disastrous. Therefore we are going to play around with a couple of Terminal programs to change the attributes of files, folders and even Hard Drives so we can hide them from view.</p>
<p>Before we start you need to have the developer tools installed. Since we use two special Terminal files that get installed when the developer tools are installed. To install the tools simply  insert your installation disk that comes with your Mac or follow this post on <a href="http://www.mactricksandtips.com/2010/02/installing-xcode.html">Installing XCode</a>. I would just post the two files needed, however I don&#8217;t have the right to distribute them.</p>
<p>Once the developer tools are installed we are ready to go. We are going to use two Terminal programs, GetFileInfo and SetFile. The first is used to see the file attributes the second to change them. We are going to change the file attributes so it is hidden. First off open up Terminal under Utilities and type the following, we are going to hide a BootCamp partition, although it can be applied to any file, folder or disk.</p>
<p><code>GetFileInfo /Volumes/BOOTCAMP</code></p>
<p>It will post results similar to the following.</p>
<p><code>directory: "/Volumes/BOOTCAMP"<br />
attributes: avbstclinmedz<br />
created: 01/01/1904 00:00:00<br />
modified: 06/23/2010 13:59:22</code></p>
<p>The second line is something that we are interested in. It has a line of attributes that we can change, although the letters are meaningless at this point they each represent something that can be changed, we are going to change the visibility attribute so it disappears. In Terminal again, type the following.</p>
<p><code>sudo SetFile -a V /Volumes/BOOTCAMP</code></p>
<p>This uses the SetFile program to change the attribute setting (-a) to invisible &#8220;V&#8221;, for the Volume BOOTCAMP, change the string at the end to anything you want. Use the full path to the file to make sure you don&#8217;t hide anything you don&#8217;t want.</p>
<p>After a quick moment the hard drive or anything you are hiding is gone. It wont be visible in Finder, but is still there with the original file name. If you are hiding a hard drive and a hard drive icon with the name &#8220;client node&#8221; appear, simply log off and back on again for it to disappear. I don&#8217;t no what it is, but it is relatively harmless.</p>
<p>This trick can be done with pretty much anything, i&#8217;ve tested it will files and folders as well and they all disappear. If you want to change anything back so you can see it again, type the following into Terminal.<br />
<code><br />
sudo SetFile -a v /Volumes/BOOTCAMP</code></p>
<p>All that is change is the attribute item &#8220;v&#8221;. Its can from on, to off. If you want to see the different that you can change just type &#8220;SetFile&#8221; into Terminal. Err on the side of caution if you change anything as it may be difficult to revert.</p>
<p>Overall this is a very simple, and quite a useful trick. It could be used to hide your Macintosh hard drive if you have children that like to mess things up. There is quite a few possibilities that can be done with this little program.</p>
<p>Want to catch up on the latest <a href="http://www.twitter.com/mactricksandtip">Tweets</a> about this site, follow me on Twitter.
<br /><br/>You have just read <a href="http://www.mactricksandtips.com/2010/06/hide-select-icons-from-view-incl-hard-drives.html">Hide Select Icons From View (incl Hard Drives)</a>,<br /><br/>On <a href="http://www.mactricksandtips.com">Mac Tricks And Tips</a> - The site all about Mac Tips, Tricks, Tools, Guides and so much more. </p>


<p>Related posts:<ol><li><a href='http://www.mactricksandtips.com/2010/01/solving-minor-problems-incl-crashes-in-apps.html' rel='bookmark' title='Permanent Link: Solving Minor Problems (incl Crashes) In Apps'>Solving Minor Problems (incl Crashes) In Apps</a></li>
<li><a href='http://www.mactricksandtips.com/2009/07/hide-the-menubar-or-dock-in-specific-apps.html' rel='bookmark' title='Permanent Link: Hide The MenuBar or Dock In Specific Apps'>Hide The MenuBar or Dock In Specific Apps</a></li>
<li><a href='http://www.mactricksandtips.com/2008/10/hide-a-programs-dock-icon-while-it-is-running.html' rel='bookmark' title='Permanent Link: Hide A Programs Dock Icon'>Hide A Programs Dock Icon</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

