<?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; Unix</title>
	<atom:link href="http://www.mactricksandtips.com/category/unix/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mactricksandtips.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 09 Feb 2012 14:41:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Giving TextEdit Root For Locked Files</title>
		<link>http://www.mactricksandtips.com/2008/05/giving-textedit-root-for-locked-files.html</link>
		<comments>http://www.mactricksandtips.com/2008/05/giving-textedit-root-for-locked-files.html#comments</comments>
		<pubDate>Tue, 20 May 2008 18:10:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Text Edit]]></category>
		<category><![CDATA[User]]></category>

		<guid isPermaLink="false">http://localhost:8888/2008/05/giving-textedit-root-for-locked-files.html</guid>
		<description><![CDATA[Once as you get to know your Mac and you are more confident in how it works, and what everything does, you may want to starting playing with the system files. Usually I strongly suggest you don't play with any of them to be on the safe side. But every so often you may need to edit a certain file to achieve a specific task. For example if you are using the web server built into a Mac and you want to edit the httpd.conf file. Normally you would have to give yourself permission to edit the file, and then open up it up. Or you could use vim or pico, a Terminal file editing program. Both of these take a while to learn (especially vim and pico) or take a long time to implement (changing file permissions). What we want is the ability to give TextEdit root powers to edit these files, while still using the GUI of TextEdit. Its rather simple.<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/2008/05/giving-textedit-root-for-locked-files.html">Giving TextEdit Root For Locked Files</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/02/enabling-root-user-on-a-mac.html' rel='bookmark' title='Permanent Link: Enabling Root User On A Mac'>Enabling Root User On A Mac</a></li>
<li><a href='http://www.mactricksandtips.com/2008/05/understanding-hidden-root-folders.html' rel='bookmark' title='Permanent Link: Understanding Hidden Root Folders'>Understanding Hidden Root Folders</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>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>Once as you get to know your Mac and you are more confident in how it works, and what everything does, you may want to starting playing with the system files. Usually I strongly suggest you don&#8217;t play with any of them to be on the safe side. But every so often you may need to edit a certain file to achieve a specific task. For example if you are using the web server built into a Mac and you want to edit the httpd.conf file. Normally you would have to give yourself permission to edit the file, and then open up it up. Or you could use vim or pico, a Terminal file editing program. Both of these take a while to learn (especially vim and pico) or take a long time to implement (changing file permissions). What we want is the ability to give TextEdit root powers to edit these files, while still using the GUI of TextEdit. Its rather simple.</p>
<p>For this little experiment I am going to use httpd.conf in /etc/apache2. This can be accessed from Finder by going to Go &gt; Go To Folder and then typing /etc. You can then navigate to the file in question. This file, to me, is doing nothing since I am not using the web server. If you open this file, edit it and try to save you will get an error which looks something like this.</p>
<p><a href="http://www.mactricksandtips.com/wp-content/uploads/2008/05/text-edit-locked-files.png"><img class="aligncenter size-medium wp-image-2278" title="text edit locked files" src="http://www.mactricksandtips.com/wp-content/uploads/2008/05/text-edit-locked-files-300x110.png" alt="" width="300" height="110" /></a><br />
The next step is to quit TextEdit (very important) and then open up Terminal (Utilities &gt; Terminal). Then type of following:</p>
<p><code>sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit</code></p>
<p>It will ask you for you admin password. Once as you have entered you are ready to go. When you open TextEdit again it will have root powers to enable you to write to these locked files. If you have the Graphite (or any other theme) appearance set in System Preference, it may revert back to the blue version. It did on my machine. But it clears it self up once as the program has closed.</p>
<p>You can now go around editing and saving these locked files without the need to change permissions or use a Terminal program. Once as you have quit the program the sudo will be undone and you will be back to normal TextEdit.</p>
<p>Using this method means that you don&#8217;t have to go around changing all of the files permissions or learn vim or pico. Its simple and easy to use. You can of course open up all of the files you want with TextEdit and edit them at will. You can then be back to safe old TextEdit when the program is closed. Using this little tip means that file permissions stay the same so you don&#8217;t compromise your computers security if you forget to change them back.</p>
<p>Be careful since you do have sudo powers in effect, changing anything you don&#8217;t no could have disastrous consequences. A later post will be about creating a file which can run in Terminal so you don&#8217;t have to type this command over and over.</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/2008/05/giving-textedit-root-for-locked-files.html">Giving TextEdit Root For Locked Files</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/02/enabling-root-user-on-a-mac.html' rel='bookmark' title='Permanent Link: Enabling Root User On A Mac'>Enabling Root User On A Mac</a></li>
<li><a href='http://www.mactricksandtips.com/2008/05/understanding-hidden-root-folders.html' rel='bookmark' title='Permanent Link: Understanding Hidden Root Folders'>Understanding Hidden Root Folders</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>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Understanding Hidden Root Folders</title>
		<link>http://www.mactricksandtips.com/2008/05/understanding-hidden-root-folders.html</link>
		<comments>http://www.mactricksandtips.com/2008/05/understanding-hidden-root-folders.html#comments</comments>
		<pubDate>Mon, 19 May 2008 20:09:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Finder]]></category>
		<category><![CDATA[Hidden]]></category>
		<category><![CDATA[Root]]></category>
		<category><![CDATA[Super user]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://localhost:8888/2008/05/understanding-hidden-root-folders.html</guid>
		<description><![CDATA[The Mac system, as you might well know is built on Unix. As a result there is a lot of Unix folders in the root system. This post is going to explain for people new the the Mac system a general understanding of what each folder does. This is designed to be a simple guide for new users, so experienced Unix and Mac developers probably know a lot more than me. You have to learn from somewhere.<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/2008/05/understanding-hidden-root-folders.html">Understanding Hidden Root Folders</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/02/enabling-root-user-on-a-mac.html' rel='bookmark' title='Permanent Link: Enabling Root User On A Mac'>Enabling Root User On A Mac</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/hiding-folders.html' rel='bookmark' title='Permanent Link: Hiding Folders'>Hiding Folders</a></li>
<li><a href='http://www.mactricksandtips.com/2009/01/osxp-folders-plugin-for-windows-style-folders.html' rel='bookmark' title='Permanent Link: OSXP Folders &#8211; Plugin For Windows Style Folders'>OSXP Folders &#8211; Plugin For Windows Style Folders</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>The Mac system, as you might well know is built on Unix. As a result there is a lot of Unix folders in the root system. This post is going to explain for people new the the Mac system a general understanding of what each folder does. This is designed to be a simple guide for new users, so experienced Unix and Mac developers probably know a lot more than me. You have to learn from somewhere.</p>
<p>The first step is to show theses hidden folders. You can use one of three ways. <a href="http://www.mactricksandtips.com/2008/03/secrets-preference-pane.html">Secrets</a> preference pane, where you show hidden files (the quickest). <a href="http://www.mactricksandtips.com/2008/02/ultimate-list-of-quicklook-plugins.html">Quicklook</a>, folder plugin where you can show hidden files in quicklook (safest). Or command line, in which you can actually see the folders. If you want to use the Terminal root to show the files type:</p>
<p><code>defaults write com.apple.finder AppleShowAllFiles TRUE<br />
killall Finder<br />
</code><br />
To reverse the command type false instead of true.</p>
<p><a href="http://www.mactricksandtips.com/wp-content/uploads/2008/05/view-hidden-files.png"><img class="aligncenter size-medium wp-image-2272" title="view hidden files" src="http://www.mactricksandtips.com/wp-content/uploads/2008/05/view-hidden-files-300x279.png" alt="" width="300" height="279" /></a><br />
My root folder will look very different to yours (probably). This is due to the installed programs and devices that I might have. But the main folders should be there.</p>
<p><span style="font-weight: bold;">.Trashes</span></p>
<p>A directory that stores the files that have been deleted but not permanently deleted. You have one of these folders in every folder that you delete a file from.</p>
<p><span style="font-weight: bold;">bin</span></p>
<p>Used to store binary files that you run from in Terminal and other applications. Contains programs such as rm (deleting stuff) and chmod (change file permissions) to name a few.</p>
<p><span style="font-weight: bold;">core</span></p>
<p>If a program has crashed and it dumps its memory into this folder. Only really used by developers.</p>
<p><span style="font-weight: bold;">dev</span></p>
<p>A place holder to keep track of various devices such as mice, keyboards etc.</p>
<p><span style="font-weight: bold;">etc</span></p>
<p>The configuration for storing all of the configurations for various programs. Will actually link to /private/etc. Stuff like apache web server config files are in here if you are running a webserver.</p>
<p><span style="font-weight: bold;">mach_kernal</span></p>
<p>The kernal files for running Mac operating system. The very core of the OS. If you fiddle with these files and you don&#8217;t no what you are doing you are in serious trouble.</p>
<p><span style="font-weight: bold;">private</span></p>
<p>Contains the actual folders for etc, tmp and var. Compared with aliases for the folders in root.</p>
<p><span style="font-weight: bold;">sbin</span></p>
<p>Again, contains more binaries this time for system administration and configuration.</p>
<p><span style="font-weight: bold;">tmp</span></p>
<p>Pretty much what it says on the tin. A place in which programs can store temporary files during installation. The actual location is /private/tmp.</p>
<p><span style="font-weight: bold;">usr</span></p>
<p>Another binary folder but this time it stores all of the binaries relating to user tasks. There are various folders which do ever so slight different tasks but it all relates to the user, compared to root and system config.</p>
<p><span style="font-weight: bold;">var</span></p>
<p>A place for storing configuration files and log files. Var/root is the home directory as the root user. Var/vm contains both your swap files and sleep image. The swap files is used when you are starting to run out of real memory. Mine is only at 64mb which isn&#8217;t to bad, probably why my computer is running fast today. If this file is very large, it might be time to invest in some more ram.</p>
<p><span style="font-weight: bold;">Volumes</span></p>
<p>Contains links to all of the mount points of volumes stored on your system.</p>
<p>Hopefully if you didn&#8217;t know before about root unix folders you should now. As stated before this is just a brief overview to give you an idea of how things work. As a final tip don&#8217;t both playing around with them unless you know what you are doing. A lot can go wrong in these folders. Thats probably why Apple hides them.</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/2008/05/understanding-hidden-root-folders.html">Understanding Hidden Root Folders</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/02/enabling-root-user-on-a-mac.html' rel='bookmark' title='Permanent Link: Enabling Root User On A Mac'>Enabling Root User On A Mac</a></li>
<li><a href='http://www.mactricksandtips.com/2008/07/hiding-folders.html' rel='bookmark' title='Permanent Link: Hiding Folders'>Hiding Folders</a></li>
<li><a href='http://www.mactricksandtips.com/2009/01/osxp-folders-plugin-for-windows-style-folders.html' rel='bookmark' title='Permanent Link: OSXP Folders &#8211; Plugin For Windows Style Folders'>OSXP Folders &#8211; Plugin For Windows Style Folders</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cool Unix Terminal Comnmands</title>
		<link>http://www.mactricksandtips.com/2008/05/cool-unix-terminal-comnmands.html</link>
		<comments>http://www.mactricksandtips.com/2008/05/cool-unix-terminal-comnmands.html#comments</comments>
		<pubDate>Fri, 02 May 2008 17:36:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://localhost:8888/2008/05/cool-unix-terminal-comnmands.html</guid>
		<description><![CDATA[I love Terminal. It ease of use and the raw power behind such a small little application. Anyway I have been looking on the internet during an hour of boredom to find cool and interesting commands which you can use in Terminal to show some cool statistics. This post sort of follows on from Playing Games In Terminal, which I posted eariler. These commands are designed to be low level and not very powerful. I have only posted a few, but if you do know any more please leave a comment below.<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/2008/05/cool-unix-terminal-comnmands.html">Cool Unix Terminal Comnmands</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/2008/09/cool-coda-clips-collections.html' rel='bookmark' title='Permanent Link: Cool Coda Clips Collections'>Cool Coda Clips Collections</a></li>
<li><a href='http://www.mactricksandtips.com/2009/08/introduction-to-terminal-noob2pro-21.html' rel='bookmark' title='Permanent Link: Introduction To Terminal &#8211; Noob2Pro #21'>Introduction To Terminal &#8211; Noob2Pro #21</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hey</p>
<p>I love Terminal. It ease of use and the raw power behind such a small little application. Anyway I have been looking on the internet during an hour of boredom to find cool and interesting commands which you can use in Terminal to show some cool statistics. This post sort of follows on from <a href="http://www.mactricksandtips.com/2008/02/play-games-in-terminal.html">Playing Games In Terminal</a>. These commands are designed to be low level and not very powerful. I have only posted a few, but if you do know any more please leave a comment below.</p>
<p>All of these commands are accessed by just typing the command in a Terminal window. A couple you will have to close out of to get back to a normal screen.</p>
<p>1) uptime</p>
<p>Very simple command that shows you the time your computer has been running as well as the load. The load when you read it is the amount of processes ready to run. You can read more about load on <a href="http://en.wikipedia.org/wiki/Load_%28computing%29">wikipedia</a>.</p>
<p>2) top</p>
<p>Like Activity Monitor but from within Terminal. The top command shows you the top processes running on your computer. Not as efficient as Activity Monitor as the command does take up quite a bit of CPU. You can read more on this command <a href="http://en.wikipedia.org/wiki/Top_%28Unix%29">here</a>.</p>
<p><a href="http://www.mactricksandtips.com/wp-content/uploads/2008/05/mac-terminal-top.png"><img class="aligncenter size-medium wp-image-2243" title="mac terminal top" src="http://www.mactricksandtips.com/wp-content/uploads/2008/05/mac-terminal-top-300x212.png" alt="" width="300" height="212" /></a><br />
3) netstat</p>
<p>Quite an interesting command. It shows you all of the active TCP and UDP network connections on your computer. A very powerful little tool. If you just type netstat it will show what connections have been made. But if you type netstat -w 1 (with the spaces) it will update and show you statistics based on the connections you are currently running. If you head over to <a href="http://en.wikipedia.org/wiki/Netstat">wikipedia</a> again you can find some more information, not all of the commands work mind you.</p>
<p><a href="http://www.mactricksandtips.com/wp-content/uploads/2008/05/mac-terminal-net-stat.png"><img class="aligncenter size-medium wp-image-2244" title="mac terminal net stat" src="http://www.mactricksandtips.com/wp-content/uploads/2008/05/mac-terminal-net-stat-300x188.png" alt="" width="300" height="188" /></a><br />
If you know of any more cool commands within Unix or Mac please leave one below. In the mean time I am off to play.</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/2008/05/cool-unix-terminal-comnmands.html">Cool Unix Terminal Comnmands</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/2008/09/cool-coda-clips-collections.html' rel='bookmark' title='Permanent Link: Cool Coda Clips Collections'>Cool Coda Clips Collections</a></li>
<li><a href='http://www.mactricksandtips.com/2009/08/introduction-to-terminal-noob2pro-21.html' rel='bookmark' title='Permanent Link: Introduction To Terminal &#8211; Noob2Pro #21'>Introduction To Terminal &#8211; Noob2Pro #21</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

