<?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>NetDevo</title>
	<atom:link href="http://www.netdevo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.netdevo.com</link>
	<description>Dev, Tech &#38; Etc..</description>
	<lastBuildDate>Fri, 29 Oct 2010 13:57:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Useful SSH Commands</title>
		<link>http://www.netdevo.com/2010/10/11/useful-ssh-commands/</link>
		<comments>http://www.netdevo.com/2010/10/11/useful-ssh-commands/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 13:43:49 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[External]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.netdevo.com/?p=156</guid>
		<description><![CDATA[I&#8217;ve always wanted to put those nifty shell commands I&#8217;ve been collecting over the years all together in one place. So finally here it comes&#8230; Please note some of these may not run on all hosting solutions. Connect Change Directory List Files and Subdirectories Start,Stop and Restart Services Plesk Processes File System Commands Delete, Remove [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always wanted to put those nifty shell commands I&#8217;ve been collecting over the years all together in one place.</p>
<p>So finally here it comes&#8230;</p>
<p>Please note some of these may not run on all hosting solutions.</p>
<ol>
<li><a href="#connect"><strong>Connect</strong></a></li>
<li><a href="#change directory"><strong>Change Directory</strong></a></li>
<li><a href="#list files"><strong>List Files and Subdirectories</strong></a></li>
<li><a href="#services"><strong>Start,Stop and Restart Services</strong></a></li>
<li><a href="#plesk"><strong>Plesk</strong></a></li>
<li><a href="#processes"><strong>Processes</strong></a></li>
<li><a href="#file system"><strong>File System Commands</strong></a></li>
<li><a href="#files"><strong>Delete, Remove and Move Files</strong></a></li>
<li><a href="#permissions"><strong>File Permissions and Ownership</strong></a></li>
<li><a href="#logs"><strong>Log Files</strong></a></li>
<li><a href="#editors"><strong>Text Editors</strong></a></li>
</ol>
<h3><a name="connect">Connect</a></h3>
<pre class="brush: bash; title: ; notranslate">
General:
ssh user@server-ip
</pre>
<h3><a name="change directory">Change Directory</a></h3>
<pre class="brush: bash; title: ; notranslate">
General:
cd /path/to/directory

Run as root user:
sudo cd /path/to/directory

Go one level up:
cd ..
</pre>
<h3><a name="list files">List Files and Subdirectories</a></h3>
<pre class="brush: bash; title: ; notranslate">
General:
ls /path/to/directory

List with permissions in human-readable sizes:
ls -alh /path/to/directory

List the contents of your home directory:
ls ~

List the contents of your root directory:
ls /

List the contents of the parent directory:
ls ../

List the contents of all sub directories:
ls */

Only list the directories in the current directory:
ls -d */
</pre>
<h3><a name="services">Start,Stop and Restart Services</a></h3>
<pre class="brush: bash; title: ; notranslate">
General:
sudo etc/init.d/&lt;service&gt; start|stop|restart|status

For Apache:
sudo apachectl restart
or
sudo etc/init.d/httpd restart
</pre>
<h3><a name="plesk">Plesk</a></h3>
<pre class="brush: bash; title: ; notranslate">
Retrive admin password:
cat /etc/psa/.psa.shadow
</pre>
<h3><a name="processes">Processes</a></h3>
<pre class="brush: bash; title: ; notranslate">
Process Viewer (ctrl + C to exit):
ps -a top -c

Process List:
ps -auxf
</pre>
<h3><a name="file system">File System Commands</a></h3>
<pre class="brush: bash; title: ; notranslate">
Check total disk usage:
df

Check free disk space:
df -h

List folder sizes:
du -hs

List folder sizes greater than 1GB:
du -hs | grep G

List all subfolders/sizes:
du -sh
</pre>
<h3><a name="files">Delete, Remove and Move Files</a></h3>
<pre class="brush: bash; title: ; notranslate">
Force delete:
rm -vf

Force delete folder, subfolders and files:
rm -vrf

Remove directory:
rmdir

Move files:
mv filename.abc /newpath/filename.abc

Create empty file:
touch filename.abc
</pre>
<h3><a name="permissions">File Permissions and Ownership</a></h3>
<pre class="brush: bash; title: ; notranslate">
Change permission of files:
chmod 000 filename.abc

Permission digits meaning:
The 3 digits stand for Owner, Group, Public

Permission codes meaning:
7 = Read + Write + Execute
6 = Read + Write
5 = Read + Execute
4 = Read
3 = Write + Execute
2 = Write
1 = Execute
0 = All access denied

Change ownership:
chown user:group filename.abc
</pre>
<h3><a name="logs">Log Files</a></h3>
<pre class="brush: bash; title: ; notranslate">
List 100 last entries in Main error log:
tail -n 100 /var/log/messages

Apache error log:
/var/log/httpd/error_log

Apache per domain error log:
/home/httpd/vhosts/mt-example.com/statistics/logs/error_log

MySQL logs:
/var/log/MySQLd.log

Mail logs:
/usr/local/psa/var/log/maillog
</pre>
<h3><a name="editors">Text Editors</a></h3>
<pre class="brush: bash; title: ; notranslate">
My favourite text editor is Nano:
sudo nano /path/to/filename.abc

Installing Nano:
sudo apt-get install nano

Vi:
sudo vi /path/to/filename.abc
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.netdevo.com/2010/10/11/useful-ssh-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New blog in the pipe lines!</title>
		<link>http://www.netdevo.com/2010/05/14/new-blog-in-the-pipe-lines/</link>
		<comments>http://www.netdevo.com/2010/05/14/new-blog-in-the-pipe-lines/#comments</comments>
		<pubDate>Fri, 14 May 2010 23:26:24 +0000</pubDate>
		<dc:creator>Leo</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Thematic]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.netdevo.com/?p=4</guid>
		<description><![CDATA[Just finished putting the new blog live! The new simplified design is based on the original API MONK design conceived early 2009. The design was turned into a bespoke child theme called NetDevo based on the powerful Thematic framework. The NetDevo theme will be available to download in the near future.]]></description>
			<content:encoded><![CDATA[<p>Just finished putting the new blog live!</p>
<p>The new simplified design is based on the original API MONK design conceived early 2009. The design was turned into a bespoke child theme called NetDevo based on the powerful <a title="Thematic Framework" href="http://themeshaper.com/thematic/" target="_blank">Thematic</a> framework. The NetDevo theme will be available to download in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.netdevo.com/2010/05/14/new-blog-in-the-pipe-lines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

