<?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>1-800-HOSTING Blog &#187; cli</title>
	<atom:link href="http://blog.800hosting.com/tag/cli/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.800hosting.com</link>
	<description>Inside 1-800-HOSTING</description>
	<lastBuildDate>Mon, 19 Jul 2010 21:04:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux Shell Insights: Volume 2</title>
		<link>http://blog.800hosting.com/2009/05/linux-shell-insights-volume-2/</link>
		<comments>http://blog.800hosting.com/2009/05/linux-shell-insights-volume-2/#comments</comments>
		<pubDate>Tue, 26 May 2009 23:40:14 +0000</pubDate>
		<dc:creator>Jonathan Kelley</dc:creator>
				<category><![CDATA[Fun Stuff]]></category>
		<category><![CDATA[Industry]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[1-800-HOSTING]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.800hosting.com/?p=548</guid>
		<description><![CDATA[My last volume Linux Shell Insights: Volume 1 had some talk on the social plane about it so here&#8217;s Volume 2. Enjoy.
Here are a few more one-liners. I also call for the assistance of our audience; if anyone has more reliable or efficient methods to accomplish the ends in this article, get involved and comment!

Obtain [...]]]></description>
			<content:encoded><![CDATA[<p>My last volume <a href="http://blog.800hosting.com/2009/05/linux-shell-insights-volume-1/">Linux Shell Insights: Volume 1</a> had some talk on the social plane about it so here&#8217;s Volume 2. Enjoy.</p>
<p>Here are a few more one-liners. I also call for the assistance of our audience; if anyone has more reliable or efficient methods to accomplish the ends in this article, get involved and comment!<span id="more-548"></span></p>
<ol>
<li><strong>Obtain your internet IP</strong><br />
There are two ways to do this (both below.) This can be useful in bash scripts that require your IP address. It&#8217;s useful in a dynamic IP environment when handling dynamic DNS in some fashion; though can be useful in a variety of scripts in which NAT may exist making eth0 unreliable for this information.</p>
<div style="overflow: auto; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# wget -O &#8211; -q checkip.dyndns.org | grep -o &#8220;[[:digit:].]+&#8221;</div>
<p>You can also use curl if it&#8217;s your tool-of-choice.</p>
<div style="overflow: auto; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# curl -s http://checkip.dydns.org/ | grep -o &#8220;[[:digit:].]+&#8221;</div>
<p>If you&#8217;ve got a static IP that is directly connected to the internet; it&#8217;s best to just scrape the information out of ifconfig.</p>
<div style="white-space: pre-wrap; word-wrap: break-word; overflow: auto; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# /sbin/ifconfig eth0 | grep inet | grep -o &#8220;[[:digit:].]+&#8221; | head -n 1</div>
</li>
<li><strong>Get Distribution Information/Version</strong><br />
From time to time we get support tickets or calls asking &#8220;What distribution of Linux am I running?&#8221;. Here&#8217;s a way to ascertain this under most modern Linux distributions we offer.</p>
<p>Most Linux distributions follow the &#8220;<a href="http://en.wikipedia.org/wiki/Linux_Standard_Base">Linux Standard Base</a>&#8221; and have a file in /etc matching *release. You can take a look by running:</p>
<div style="overflow: auto; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# cat /etc/*release</div>
<p>This does the same thing if you find it easier to remember.</p>
<div style="overflow: auto; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# lsb_release &#8211;all</div>
<p>NOTE: You may have to cat the file /etc/debian_version on some Debian releases.</li>
<li><strong>Shortcut to list all system users</strong><br />
I stumbled upon this one by a typo once where you can get a peek of system users. This shouldn&#8217;t be considered authoritative, as /etc/passwd is your daddy; but it&#8217;s quick to verify the spelling of that strange developer who insists on the username supercalifragilistic_expialidocious.<br />
Tested on: Debian, Redhat</p>
<div style="overflow: auto; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# ~(HIT TAB TWICE HERE)</div>
</li>
<li><strong>Lost Plesk Password</strong><br />
Here&#8217;s one of those gems that we keep close to our chest, but I&#8217;m willing to reveal it to you. If you misplace your Plesk Admin password, on UNIX it stores it in /etc/psa/.psa.shadow. This is a read-only file, changing the password here does not change it for Plesk. It&#8217;s a good way to jot your memory if you forget though.</p>
<div style="overflow: auto; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# cat /etc/psa/.psa.shadow</div>
</li>
</ol>
<p>Continue to keep an eye out for my next list!</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.800hosting.com/2009/05/linux-shell-insights-volume-1/" title="Linux Shell Insights: Volume 1">Linux Shell Insights: Volume 1</a></li><li><a href="http://blog.800hosting.com/2010/02/php-script-tips-and-resources/" title="PHP Script Tips and Resources">PHP Script Tips and Resources</a></li><li><a href="http://blog.800hosting.com/2009/12/drupal-free-website-building-tool/" title="Drupal &#8211; Free Website Building Tool">Drupal &#8211; Free Website Building Tool</a></li><li><a href="http://blog.800hosting.com/2010/01/employee-appreciation-and-the-lost-art-of-the-road-trip/" title="Employee Appreciation and the Lost Art of the Road Trip">Employee Appreciation and the Lost Art of the Road Trip</a></li><li><a href="http://blog.800hosting.com/2010/01/a-resolution-to-keep-resolutions/" title="A Resolution to Keep Resolutions">A Resolution to Keep Resolutions</a></li><li><a href="http://blog.800hosting.com/2009/12/happy-holidays/" title="Happy Holidays!">Happy Holidays!</a></li><li><a href="http://blog.800hosting.com/2009/12/a-little-security-goes-a-loooong-way/" title="A Little Security Goes a LOOOONG Way">A Little Security Goes a LOOOONG Way</a></li><li><a href="http://blog.800hosting.com/2009/12/using-mac-as-a-work-pc-the-first-6-months/" title="Using Mac as a Work PC, the First 6 Months">Using Mac as a Work PC, the First 6 Months</a></li><li><a href="http://blog.800hosting.com/2009/11/hosted-microsoft-exchange/" title="Hosted Microsoft Exchange?">Hosted Microsoft Exchange?</a></li><li><a href="http://blog.800hosting.com/2009/11/linux-tip-setting-up-key-based-authentication/" title="Linux Tip: Setting up key-based authentication.">Linux Tip: Setting up key-based authentication.</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.800hosting.com/2009/05/linux-shell-insights-volume-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Shell Insights: Volume 1</title>
		<link>http://blog.800hosting.com/2009/05/linux-shell-insights-volume-1/</link>
		<comments>http://blog.800hosting.com/2009/05/linux-shell-insights-volume-1/#comments</comments>
		<pubDate>Wed, 06 May 2009 20:57:43 +0000</pubDate>
		<dc:creator>Jonathan Kelley</dc:creator>
				<category><![CDATA[Fun Stuff]]></category>
		<category><![CDATA[Industry]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[1-800-HOSTING]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://blog.800hosting.com/?p=433</guid>
		<description><![CDATA[Hello readers,
I thought I&#8217;d share some intriguing and useful one-liners that could make your life easier on the Linux/Unix shell environment. I hope to offer a regular multi-part series for those who are fans of the Linux platform.

View Physical Console via SSH
This will view the console (and makes assumption that the console is an 80 [...]]]></description>
			<content:encoded><![CDATA[<p>Hello readers,</p>
<p>I thought I&#8217;d share some intriguing and useful one-liners that could make your life easier on the Linux/Unix shell environment. I hope to offer a regular multi-part series for those who are fans of the Linux platform.<span id="more-433"></span></p>
<ol>
<li><strong>View Physical Console via SSH</strong><br />
This will view the console (and makes assumption that the console is an 80 character screen.) It&#8217;s helpful to scrape error messages that are printed to the local console. Great for when you don&#8217;t have physical access to the server and need to see the terminal; we also find it useful here by eliminating unnecessary trips to the data center floor.</p>
<p><span style="auto: visible; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# sudo cat /dev/vcs1 | fold -w 80</span></li>
<li><strong>Remove multiple RPM packages by a defined pattern</strong><br />
This is useful for remove all packages that are part of a common suite. This example would uninstall any package in the system with &#8216;php&#8217; in the name. (Disclaimer: Check what packages contain the string prior to running this. Unpredictable results could remove system critical packages! I&#8217;d suggest this for advanced shell users only.)</p>
<p><span style="auto: visible; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# yum erase `yum list installed | grep &#8216;php&#8217;`</span></li>
<li><strong>Reduce a file to zero bytes</strong><br />
I&#8217;m sure every administrator has needed to zero out a log file taking too much space; or clear a users mail spool. Many commands involve piping /dev/null to the file or similar. The following command is probably the easiest and quickest way that many users overlook.</p>
<p><span style="auto: visible; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# &gt; file_to_wipe.txt</span></li>
<li><strong>Look at the strings stored in RAM</strong><br />
This one is more for fun; though it could be used for security auditing. This command will access the system RAM and reveal text strings stored in memory. Don&#8217;t worry, this file is read-only by the kernel. You can usually find interesting data stored in memory with this command.</p>
<p><span style="auto: visible; font-family: Courier New; background-color: black; border: medium double grey; color: white">shell# sudo dd if=/dev/mem | cat | strings</span></li>
</ol>
<p>That&#8217;s it for now; more in this series coming soon.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.800hosting.com/2009/05/linux-shell-insights-volume-2/" title="Linux Shell Insights: Volume 2">Linux Shell Insights: Volume 2</a></li><li><a href="http://blog.800hosting.com/2010/02/php-script-tips-and-resources/" title="PHP Script Tips and Resources">PHP Script Tips and Resources</a></li><li><a href="http://blog.800hosting.com/2009/12/drupal-free-website-building-tool/" title="Drupal &#8211; Free Website Building Tool">Drupal &#8211; Free Website Building Tool</a></li><li><a href="http://blog.800hosting.com/2010/01/employee-appreciation-and-the-lost-art-of-the-road-trip/" title="Employee Appreciation and the Lost Art of the Road Trip">Employee Appreciation and the Lost Art of the Road Trip</a></li><li><a href="http://blog.800hosting.com/2010/01/a-resolution-to-keep-resolutions/" title="A Resolution to Keep Resolutions">A Resolution to Keep Resolutions</a></li><li><a href="http://blog.800hosting.com/2009/12/happy-holidays/" title="Happy Holidays!">Happy Holidays!</a></li><li><a href="http://blog.800hosting.com/2009/12/a-little-security-goes-a-loooong-way/" title="A Little Security Goes a LOOOONG Way">A Little Security Goes a LOOOONG Way</a></li><li><a href="http://blog.800hosting.com/2009/12/using-mac-as-a-work-pc-the-first-6-months/" title="Using Mac as a Work PC, the First 6 Months">Using Mac as a Work PC, the First 6 Months</a></li><li><a href="http://blog.800hosting.com/2009/11/hosted-microsoft-exchange/" title="Hosted Microsoft Exchange?">Hosted Microsoft Exchange?</a></li><li><a href="http://blog.800hosting.com/2009/11/linux-tip-setting-up-key-based-authentication/" title="Linux Tip: Setting up key-based authentication.">Linux Tip: Setting up key-based authentication.</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.800hosting.com/2009/05/linux-shell-insights-volume-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
