<?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>Made of Everything You&#039;re Not &#187; ssh</title>
	<atom:link href="http://blog.ericlamb.net/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ericlamb.net</link>
	<description>Thoughts on programming, people and life</description>
	<lastBuildDate>Thu, 27 Oct 2011 01:29:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Linux Cheat Sheet</title>
		<link>http://blog.ericlamb.net/2009/01/linux-cheat-sheet/</link>
		<comments>http://blog.ericlamb.net/2009/01/linux-cheat-sheet/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 00:59:04 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Servers]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=641</guid>
		<description><![CDATA[Like most web developers, I use Linux on a daily basis. Because I always have to revisit how to do some of the basics from time to time I thought I&#8217;d put together a list of some of the commands I use the most along with some of their examples. NOTE: the paths are all [...]]]></description>
			<content:encoded><![CDATA[<p>Like most web developers, I use Linux on a daily basis. Because I always have to revisit how to do some of the basics from time to time I thought I&#8217;d put together a list of some of the commands I use the most along with some of their examples. NOTE: the paths are all from RHEL 4 and CENTOS 4 &#038; 5.</p>
<div id="attachment_1244" class="wp-caption aligncenter" style="width: 260px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/01/linux.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F01%2Flinux.jpg','Linux')"><img src="http://blog.ericlamb.net/wp-content/uploads/2009/01/linux-250x300.jpg" alt="Linux" title="Linux" width="250" height="300" class="size-medium wp-image-1244" /></a><p class="wp-caption-text">Linux</p></div>
<p>Enjoy!</p>
<h3>MySQL</h3>
<p>Example of mysqldump::</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysqldump <span style="color: #CC0099;">-</span>u <span style="color: #000099;">USER</span> <span style="color: #CC0099;">-</span>pPASSWORD <span style="color: #990099; font-weight: bold;">DATABASE</span> <span style="color: #CC0099;">&gt;</span> filename.sql</pre></div></div>

<p>Example of restore DB::</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql <span style="color: #CC0099;">-</span>u <span style="color: #000099;">USER</span> <span style="color: #CC0099;">-</span>p DBNAME <span style="color: #CC0099;">&lt;</span> dump.sql</pre></div></div>

<p>Start the MySQL service::</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">/</span>etc<span style="color: #CC0099;">/</span>init.d<span style="color: #CC0099;">/</span>mysqld <span style="color: #22f;">start</span></pre></div></div>

<p>Stop MySQL service::</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">/</span>etc<span style="color: #CC0099;">/</span>init.d<span style="color: #CC0099;">/</span>mysqld stop</pre></div></div>

<p>Add User::</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #22f;">GRANT</span> <span style="color: #22f;">ALL</span> <span style="color: #22f;">PRIVILEGES</span> <span style="color: #22f;">ON</span> <span style="color: #CC0099;">*</span>.<span style="color: #CC0099;">*</span> <span style="color: #22f;">TO</span> <span style="color: #008000;">'USER'</span>@<span style="color: #008000;">'localhost'</span> IDENTIFIED BY <span style="color: #008000;">'PASSWORD'</span> <span style="color: #22f;">WITH</span> <span style="color: #22f;">GRANT</span> <span style="color: #22f;">OPTION</span><span style="color: #000033;">;</span></pre></div></div>

<p>Export Single Table::</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysqldump <span style="color: #CC0099;">--</span>opt <span style="color: #CC0099;">-</span>u USER<span style="color: #CC0099;">-</span>pPASSWORD DataBaseName TableName <span style="color: #CC0099;">&gt;</span> FileName</pre></div></div>

<h3>rsync</h3>
<p>rsync is used primarily synchronize data between two directories or servers.</p>
<p>Sync 2 servers</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">rsync <span style="color: #CC0099;">-</span>p <span style="color: #CC0099;">-</span>r <span style="color: #CC0099;">-</span>a <span style="color: #CC0099;">-</span>z <span style="color: #CC0099;">-</span>v <span style="color: #CC0099;">/</span>path<span style="color: #CC0099;">/</span><span style="color: #22f;">to</span><span style="color: #CC0099;">/</span>dir 2.2.2.2:<span style="color: #CC0099;">/</span>path<span style="color: #CC0099;">/</span><span style="color: #22f;">to</span><span style="color: #CC0099;">/</span>dir</pre></div></div>

<p>Sync 2 directories</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">rsync <span style="color: #CC0099;">-</span>p <span style="color: #CC0099;">-</span>r <span style="color: #CC0099;">-</span>a <span style="color: #CC0099;">-</span>z <span style="color: #CC0099;">-</span>v <span style="color: #CC0099;">/</span>path<span style="color: #CC0099;">/</span><span style="color: #22f;">to</span><span style="color: #CC0099;">/</span>dir <span style="color: #CC0099;">/</span>path<span style="color: #CC0099;">/</span><span style="color: #22f;">to</span><span style="color: #CC0099;">/</span>new<span style="color: #CC0099;">/</span>dir</pre></div></div>

<h3>Lighttpd</h3>
<p>Start the lighttpd service::</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">/</span>etc<span style="color: #CC0099;">/</span>init.d<span style="color: #CC0099;">/</span>lighttpd <span style="color: #22f;">start</span></pre></div></div>

<p>Stop the lighttpd service::</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">/</span>etc<span style="color: #CC0099;">/</span>init.d<span style="color: #CC0099;">/</span>lighttpd stop</pre></div></div>

<p>Path to conf::</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">/</span>etc<span style="color: #CC0099;">/</span>lighttpd<span style="color: #CC0099;">/</span>lighttpd.conf</pre></div></div>

<h3>SSH</h3>
<p>Restart SSH Server</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">/</span>etc<span style="color: #CC0099;">/</span>rc.d<span style="color: #CC0099;">/</span>init.d<span style="color: #CC0099;">/</span>sshd restart</pre></div></div>

<p>Start SSH Server</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">/</span>etc<span style="color: #CC0099;">/</span>rc.d<span style="color: #CC0099;">/</span>init.d<span style="color: #CC0099;">/</span>sshd <span style="color: #22f;">start</span></pre></div></div>

<p>Stop SSH Server</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">/</span>etc<span style="color: #CC0099;">/</span>rc.d<span style="color: #CC0099;">/</span>init.d<span style="color: #CC0099;">/</span>sshd stop</pre></div></div>

<h3>Tar/GZ</h3>
<p>Create tarball</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">tar <span style="color: #CC0099;">-</span>cvf directory.tar directory<span style="color: #CC0099;">/</span></pre></div></div>

<p>Create gzipped tar file</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">tar <span style="color: #CC0099;">-</span>czvf directory.tgz directory<span style="color: #CC0099;">/</span></pre></div></div>

<p>Extracting tarball:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">tar <span style="color: #CC0099;">-</span>xvf directory.tar</pre></div></div>

<p>Extracing gzipped tar:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">tar <span style="color: #CC0099;">-</span>xzvf directory.tgz</pre></div></div>

<h3>Misc.</h3>
<p>Delete the mail queue</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">rm <span style="color: #CC0099;">/</span>var<span style="color: #CC0099;">/</span>spool<span style="color: #CC0099;">/</span>mqueue<span style="color: #808000; font-style: italic;">/*</span></pre></div></div>

<p>Count files in directory recursively</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">ls <span style="color: #CC0099;">-</span>R <span style="color: #CC0099;">-</span><span style="color: #008080;">1</span> proc <span style="color: #CC0099;">|</span> wc <span style="color: #CC0099;">-</span>l</pre></div></div>

<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/01/linux-cheat-sheet/' addthis:title='Linux Cheat Sheet '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/01/linux-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

