<?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>Shell Scripting &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="http://lifelinux.com/category/shell-scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Thu, 31 Jan 2013 13:04:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.18</generator>
	<item>
		<title>How To Start / Shutdown / Reboot Guest Operating Systems With virsh Command On KVM</title>
		<link>http://lifelinux.com/how-to-start-shutdown-reboot-guest-operating-systems-with-virsh-command-on-kvm/</link>
					<comments>http://lifelinux.com/how-to-start-shutdown-reboot-guest-operating-systems-with-virsh-command-on-kvm/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 31 Jan 2013 13:02:48 +0000</pubDate>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1504</guid>

					<description><![CDATA[<p>The virsh command is an alternative command to manage a Red Hat Enterprise Linux 5 KVM environment using a Command Line Interface(CLI). The virsh command is provided as part of the libvirt API which provides a common API to applications requiring standardized access to interact with KVM using a stable interface. The following are basic [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-start-shutdown-reboot-guest-operating-systems-with-virsh-command-on-kvm/">How To Start / Shutdown / Reboot Guest Operating Systems With virsh Command On KVM</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>The virsh command is an alternative command to manage a Red Hat Enterprise Linux 5 KVM environment using a Command Line Interface(CLI). The virsh command is provided as part of the libvirt API which provides a common API to applications requiring standardized access to interact with KVM using a stable interface.<br />
<span id="more-1504"></span><br />
The following are basic and commonly used virsh commands:</p>
<pre>
help	 print help
list	 list domains
create	 create a domain from an XML file
start	 start a previously created inactive domain
destroy	 destroy a domain
define	 define (but do not start) a domain from an XML file
domid	 convert a domain name or UUID to domain id
domuuid	 convert a domain name or id to domain UUID
dominfo	 domain information
domname	 convert a domain id or UUID to domain name
domstate domain state
quit	 quit this interactive terminal
reboot	 reboot a domain
restore	 restore a domain from a saved state in a file
resume	 resume a domain
save	 save a domain state to a file
shutdown gracefully shutdown a domain
suspend	 suspend a domain
undefine undefine an inactive domain
</pre>
<h2>List running guest VMs</h2>
<p>Type the following command:</p>
<pre>
# virsh list
</pre>
<p>Sample outputs:</p>
<pre>
Id  Name                 State
----------------------------------
1   VM01                 running
2   VM02	         running
</pre>
<h2>Staring a guest VM</h2>
<p>Type the following command:</p>
<pre>
# virsh start VM01
</pre>
<h2>Shutddowwn a guest VM</h2>
<p>Type the following command:</p>
<pre>
# virsh shutdown VM01
</pre>
<p>Or, you can forcefully stop a guest VM with following command:</p>
<pre>
# virsh destroy VM01
</pre>
<h2>Rebooting a guest VM</h2>
<p>Type the following command:</p>
<pre>
# virsh reboot VM01
</pre>
<g:plusone href="http://lifelinux.com/how-to-start-shutdown-reboot-guest-operating-systems-with-virsh-command-on-kvm/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-start-shutdown-reboot-guest-operating-systems-with-virsh-command-on-kvm/">How To Start / Shutdown / Reboot Guest Operating Systems With virsh Command On KVM</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-start-shutdown-reboot-guest-operating-systems-with-virsh-command-on-kvm/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux Random Password Generator With Bash Script</title>
		<link>http://lifelinux.com/linux-random-password-generator-with-bash-script/</link>
					<comments>http://lifelinux.com/linux-random-password-generator-with-bash-script/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sun, 24 Apr 2011 08:52:50 +0000</pubDate>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Password Generator]]></category>
		<category><![CDATA[password random]]></category>
		<category><![CDATA[random with bash]]></category>
		<category><![CDATA[random with shell]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=301</guid>

					<description><![CDATA[<p>#!/bin/bash # Under RedHat / Centos if [ $# -gt 0 ] then MIN=$1 else MIN=8 fi DEL=`expr $RANDOM % 5` LEN=`expr $MIN + $DEL` cat /dev/urandom &#124; tr -dc "a-zA-Z0-9@#*=[]" &#124; dd bs=$LEN count=1 2>/dev/null echo;</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/linux-random-password-generator-with-bash-script/">Linux Random Password Generator With Bash Script</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><pre>
#!/bin/bash
# Under RedHat / Centos

if [ $# -gt 0 ]
then
	MIN=$1
else
	MIN=8
fi

DEL=`expr $RANDOM % 5`
LEN=`expr $MIN + $DEL`
cat /dev/urandom | tr -dc "a-zA-Z0-9@#*=[]" | dd  bs=$LEN count=1 2>/dev/null
echo;
</pre>
<g:plusone href="http://lifelinux.com/linux-random-password-generator-with-bash-script/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/linux-random-password-generator-with-bash-script/">Linux Random Password Generator With Bash Script</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/linux-random-password-generator-with-bash-script/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Anti SYN Flood with IPTables</title>
		<link>http://lifelinux.com/anti-syn-flood-with-iptables/</link>
					<comments>http://lifelinux.com/anti-syn-flood-with-iptables/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 21 Apr 2011 05:53:05 +0000</pubDate>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[--hitcount]]></category>
		<category><![CDATA[anti syn flood]]></category>
		<category><![CDATA[connecttion limited by iptables]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[limit connection]]></category>
		<category><![CDATA[syn flood]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=288</guid>

					<description><![CDATA[<p>#!/bin/sh # A simple shell to build a Firewall anti SYN Flood # Under CentOS, Fedora and RHEL / Redhat Enterprise Linux # servers. # ---------------------------------------------------------------------------- # Written by LongVNIT # (c) 2009 lifeLinux under GNU GPL v2.0+ IPT="iptables" MODPROBE="modprobe" IF="eth0" IP="192.168.1.112" PORT="22 80 443" CHECK_TIME=60 BAN_TIME=120 HITCOUNT=10 MOD="ip_tables ip_conntrack iptable_filter ipt_state" # Load Module [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/anti-syn-flood-with-iptables/">Anti SYN Flood with IPTables</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><pre>
#!/bin/sh
# A simple shell to build a Firewall anti SYN Flood
# Under CentOS, Fedora and RHEL / Redhat Enterprise Linux
# servers.
# ----------------------------------------------------------------------------
# Written by LongVNIT <http://www.lifelinux.com/>
# (c) 2009 lifeLinux under GNU GPL v2.0+

IPT="iptables"
MODPROBE="modprobe"
IF="eth0"
IP="192.168.1.112"
PORT="22 80 443"
CHECK_TIME=60
BAN_TIME=120
HITCOUNT=10
MOD="ip_tables ip_conntrack iptable_filter ipt_state"

# Load Module
for M in $MOD
do
	$MODPROBE $M
done

# Flush IPTables
$IPT -F
$IPT -X
$IPT -P INPUT DROP
$IPT -P OUTPUT ACCEPT
$IPT -P FORWARD DROP

# Define SYN_CHECK CHAIN
$IPT -N SYN_CHECK

# BAN IP IN 
$IPT -t mangle -A PREROUTING -p TCP -d $IP -m recent --name SYN --update --seconds $BAN_TIME --hitcount $HITCOUNT -j DROP

# DROP INVALID PACKET
$IPT -A INPUT -p TCP ! --syn -m state --state NEW -j DROP

# ACCPET ALL ESTABLISHED PACKET
$IPT -A INPUT -i $IF -m state --state ESTABLISHED -j ACCEPT

# CHECK SYN
for P in $PORT
do
	$IPT -A INPUT -i $IF -p TCP -d $IP --dport $P -m state --state NEW -j SYN_CHECK
done

# ACCEPT
for P in $PORT
do
	$IPT -A INPUT -i $IF -p TCP -d $IP --dport $P -m state --state NEW -j ACCEPT
done

# SYN_CHECK CHAIN
$IPT -A SYN_CHECK -m recent --set --name SYN
$IPT -A SYN_CHECK -m recent --name SYN --update --seconds $CHECK_TIME --hitcount $HITCOUNT -j LOG --log-level 5 --log-prefix "SYN_FLOOD"
$IPT -A SYN_CHECK -m recent --name SYN --update --seconds $CHECK_TIME --hitcount $HITCOUNT -j DROP
</pre>
<g:plusone href="http://lifelinux.com/anti-syn-flood-with-iptables/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/anti-syn-flood-with-iptables/">Anti SYN Flood with IPTables</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/anti-syn-flood-with-iptables/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Error compiling PHP on CentOS x64</title>
		<link>http://lifelinux.com/error-compiling-php-on-centos-x64/</link>
					<comments>http://lifelinux.com/error-compiling-php-on-centos-x64/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Tue, 19 Apr 2011 02:48:27 +0000</pubDate>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[compile php]]></category>
		<category><![CDATA[compile php on x64]]></category>
		<category><![CDATA[Error compiling PHP]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=280</guid>

					<description><![CDATA[<p>configure: error: xml2-config not found. Please check your libxml2 installation. yum install libxml2-devel.x86_64 configure: error: Cannot find OpenSSL&#8217;s yum install openssl-devel.x86_64 configure: error: Could not find pcre.h in /usr/local yum install pcre-devel.x86_64 configure: error: Could not find pcre.h in /usr/local "--with-pcre-regex=/usr/include" \ configure: error: Could not find libpcre.(a&#124;so) in /usr/include "--with-pcre-regex=/usr" \ configure: error: Please [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/error-compiling-php-on-centos-x64/">Error compiling PHP on CentOS x64</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>configure: error: xml2-config not found. Please check your libxml2 installation.</p>
<pre>yum install libxml2-devel.x86_64</pre>
<p>configure: error: Cannot find OpenSSL&#8217;s</p>
<pre>yum install openssl-devel.x86_64</pre>
<p><span id="more-280"></span><br />
configure: error: Could not find pcre.h in /usr/local</p>
<pre>yum install pcre-devel.x86_64</pre>
<p>configure: error: Could not find pcre.h in /usr/local</p>
<pre>"--with-pcre-regex=/usr/include" \</pre>
<p>configure: error: Could not find libpcre.(a|so) in /usr/include</p>
<pre>"--with-pcre-regex=/usr" \</pre>
<p>configure: error: Please reinstall the libcurl distribution &#8211;<br />
easy.h should be in /include/curl/</p>
<pre>yum install curl-devel.x86_64</pre>
<p>configure: error: libjpeg.(a|so) not found.</p>
<pre>yum install libjpeg-devel.x86_64</pre>
<p>configure: error: libpng.(a|so) not found.</p>
<pre>yum install libpng-devel.x86_64</pre>
<p>configure: error: freetype.h not found.</p>
<pre>yum install freetype-devel.x86_64</pre>
<p>configure: error: Please reinstall the iconv library.</p>
<pre>"--with-iconv" \</pre>
<p>configure: error: mcrypt.h not found. Please reinstall libmcrypt.</p>
<pre>yum install libmcrypt.x86_64 libmcrypt-devel.x86_64</pre>
<p>configure: error: Please reinstall libmhash &#8211; I cannot find mhash.h</p>
<pre>yum install mhash.x86_64 mhash-devel.x86_64</pre>
<p>Note that the MySQL client library is not bundled anymore!</p>
<pre>yum install php-mysql.x86_64 mysql-devel.x86_64</pre>
<p>configure: error: Please reinstall the BZip2 distribution</p>
<pre>yum install bzip2-devel.x86_64</pre>
<p>configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.<br />
DISABLE IMAP<br />
configure: error: Cannot find pspell</p>
<pre>yum install aspell-devel.x86_64</pre>
<p>configure: error: Cannot find libtidy</p>
<pre>yum install libtidy.x86_64 libtidy-devel.x86_64</pre>
<p>error: xslt-config not found. Please reinstall the libxslt &gt;= 1.1.0 distribution</p>
<pre>yum install libxslt.x86_64 libxslt-devel.x86_64</pre>
<p>collect2: ld returned 1 exit status</p>
<pre>yum install glibc-utils.x86_64 libtool-ltdl-devel.x86_64</pre>
<h2>Step by step to guide PHP Compile</h2>
<p><strong>Step 1: </strong> Update &#038; Install Development Tools &#038; Libraries</p>
<pre>
yum update
yum group install "Development Tools"
yum group install "Development Libraries"
</pre>
<p><strong>Step 2:</strong> Run the bellow bash script</p>
<pre>#!/bin/sh
"./configure" \
"--prefix=/usr/local/php5" \
"--enable-force-cgi-redirect" \
"--enable-fastcgi" \
"--with-bz2" \
"--with-config-file-path=/usr/local/etc" \
"--with-config-file-scan-dir=/usr/local/etc/php.d" \
"--with-curl=/usr/local/lib" \
"--with-gd" \
"--with-gettext" \
"--with-jpeg-dir=/usr/local/lib" \
"--with-freetype-dir=/usr/local/lib" \
"--with-kerberos" \
"--with-mcrypt" \
"--with-mhash" \
"--with-mime-magic" \
"--with-mysql" \
"--with-mysqli" \
"--with-pcre-regex=/usr" \
"--with-pdo-mysql=shared" \
"--with-pdo-sqlite=shared" \
"--with-pear=/usr/local/lib/php" \
"--with-png-dir=/usr/local/lib" \
"--with-pspell" \
"--with-sqlite=shared" \
"--with-tidy" \
"--with-ttf" \
"--with-xmlrpc" \
"--with-xsl" \
"--with-zlib" \
"--with-zlib-dir=/usr/local/lib" \
"--with-openssl" \
"--with-iconv" \
"--with-libdir=lib64" \
"--enable-bcmath" \
"--enable-calendar" \
"--enable-exif" \
"--enable-ftp" \
"--enable-gd-native-ttf" \
"--enable-libxml" \
"--enable-magic-quotes" \
"--enable-soap" \
"--enable-sockets" \
"--enable-mbstring" \
"--enable-zip" \
"--enable-wddx"</pre>
<g:plusone href="http://lifelinux.com/error-compiling-php-on-centos-x64/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/error-compiling-php-on-centos-x64/">Error compiling PHP on CentOS x64</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/error-compiling-php-on-centos-x64/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
			</item>
		<item>
		<title>How To Keep Data Sync&#8217;d Between Two Load Balanced Servers</title>
		<link>http://lifelinux.com/how-to-keep-data-syncd-between-two-load-balanced-servers/</link>
					<comments>http://lifelinux.com/how-to-keep-data-syncd-between-two-load-balanced-servers/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 25 Nov 2010 07:35:59 +0000</pubDate>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Data Sync]]></category>
		<category><![CDATA[Load balancing]]></category>
		<category><![CDATA[mirror server]]></category>
		<category><![CDATA[rsync command]]></category>
		<category><![CDATA[sync server]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=186</guid>

					<description><![CDATA[<p>Load balancing helps provide redundancy to your website. However, one often asked question is how to keep your content synchronized on each server. If you put a new web page on one server, how does it get copied over to the second server? In this article, i&#8217;ll explain how to use rsync command to synchronize [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-keep-data-syncd-between-two-load-balanced-servers/">How To Keep Data Sync&#8217;d Between Two Load Balanced Servers</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>Load balancing</strong> helps provide redundancy to your website. However, one often asked question is how to keep your content synchronized on each server. If you put a new web page on one server, how does it get copied over to the second server? In this article, i&#8217;ll explain how to use rsync command to synchronize data between a specific directory on each server.<span id="more-186"></span></p>
<h2>Install rsync</h2>
<p>On Centos Linux type the following command:</p>
<pre>yum install rsync
</pre>
<h2>Using rsync command with password authentication</h2>
<p>For example, i have two servers using for load balanced and called server1(192.168.1.101) and server2(192.168.1.102). I wanted to keep data in /var/www/html sync between to servers. Type the following command on server1:</p>
<pre>rsync -avr --progress --links --rsh='/usr/bin/ssh' 192.168.1.102:/var/www/html /var/www/html
</pre>
<p><strong>With:</strong><br />
-avr : archive mode (a), verbose (v), recurse into directories (r).<br />
&#8211;progress: Show progress.<br />
&#8211;links: copy symlinks as symlinks.<br />
&#8211;rsh: use to specify the remote shell ssh to use.<br />
192.168.1.102:/var/www/html: IP address of server2 and path to synchronize to server1<br />
/var/www/html: Server1 path</p>
<h2>Using rsync command with <a href="http://www.lifelinux.com/setting-up-an-ssh-certificate/">SSH certificate</a></h2>
<p>Replace above command with following command:</p>
<pre>rsync -avr --progress --links --rsh='/usr/bin/ssh -i /path_to_private_key' 192.168.1.102:/var/www/html /var/www/html
</pre>
<h2>A sample shell script</h2>
<pre>#!/bin/bash
SOURCEPATH='source'
DESTPATH='destination'
SOURCEHOST='ip_address'
PRIVATEKEY='private_key'
LOGFILE='log_file'
SSH='/usr/bin/ssh'
rsync -avr --progress --links --rsh="'$SSH -i $PRIVATEKEY'" $SOURCEHOST:$SOURCEPATH $DESTPATH 2&gt;&amp;1 &gt;&gt; $LOGFILE
</pre>
<g:plusone href="http://lifelinux.com/how-to-keep-data-syncd-between-two-load-balanced-servers/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/how-to-keep-data-syncd-between-two-load-balanced-servers/">How To Keep Data Sync&#8217;d Between Two Load Balanced Servers</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/how-to-keep-data-syncd-between-two-load-balanced-servers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Check Available Memory On Linux</title>
		<link>http://lifelinux.com/check-available-memory-on-linux/</link>
					<comments>http://lifelinux.com/check-available-memory-on-linux/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 23 Nov 2010 08:45:15 +0000</pubDate>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[check available memory on linux]]></category>
		<category><![CDATA[check available ram on linux]]></category>
		<category><![CDATA[check free ram on linux]]></category>
		<category><![CDATA[check ram on linux]]></category>
		<category><![CDATA[free command]]></category>
		<category><![CDATA[vmstat command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=54</guid>

					<description><![CDATA[<p>To check avilable memory in Linux type free -m command. free displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. free -m free -h free -b Output: total used free shared buffers cached Mem: 2025 1961 64 0 172 1035 [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/check-available-memory-on-linux/">Check Available Memory On Linux</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>To check avilable memory in <strong>Linux</strong> type free -m command. free  displays  the  total  amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel.<span id="more-54"></span></p>
<pre>free -m
free -h
free -b</pre>
<p>Output:</p>
<pre>             total       used       free     shared    buffers     cached
Mem:          2025       1961         64          0        172       1035
-/  buffers/cache:        753       1272
Swap:         1906          0       1906</pre>
<ol>
<li>The -b switch displays the amount of memory in bytes</li>
<li>The -k switch (set by default) displays it in  kilobytes</li>
<li>The  -m  switch  displays  it  in megabytes</li>
<li>The -g switch displays it in gigabytes.</li>
</ol>
<pre>vmstat</pre>
<p>Output:</p>
<pre>procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0      0  63316 176624 1062340    0    0    25    18   39  592  5  1 94  0</pre>
<ol>
<li>swpd: the amount of virtual memory used.</li>
<li> free: the amount of idle memory.</li>
<li> buff: the amount of memory used as buffers.</li>
<li> cache: the amount of memory used as cache.</li>
</ol>
<g:plusone href="http://lifelinux.com/check-available-memory-on-linux/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/check-available-memory-on-linux/">Check Available Memory On Linux</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/check-available-memory-on-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Auto Update CentOS Server With yum Command</title>
		<link>http://lifelinux.com/auto-update-centos-server-with-yum-command/</link>
					<comments>http://lifelinux.com/auto-update-centos-server-with-yum-command/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 23 Nov 2010 08:42:09 +0000</pubDate>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[auto update]]></category>
		<category><![CDATA[auto yum update]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[cronjob]]></category>
		<category><![CDATA[yum]]></category>
		<category><![CDATA[yum update]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=50</guid>

					<description><![CDATA[<p>The yum command is used to install and update software under Centos, RedHat and Fedora. In this topic, i will use yum command to update Centos and configure yum to update automatically with Crontab. Create file yum_update.sh vi /etc/cron.daily/yum_update.sh With following content : #!/bin/bash /usr/bin/yum -y -R 120 -d 0 -e 0 update yum /usr/bin/yum [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/auto-update-centos-server-with-yum-command/">Auto Update CentOS Server With yum Command</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>The <strong>yum command</strong> is used to install and update software under Centos, RedHat and Fedora. In this topic, i will use yum command to update Centos and configure yum to update automatically with Crontab.<span id="more-50"></span></p>
<p>Create file yum_update.sh</p>
<pre>vi /etc/cron.daily/yum_update.sh</pre>
<p>With following content :</p>
<pre>#!/bin/bash

/usr/bin/yum -y -R 120 -d 0 -e 0 update yum

/usr/bin/yum -y -R 10 -e 0 -d 0 update</pre>
<p>-e 0 -d 0  are to only show critical errors.<br />
-R adds random delay between command execution.</p>
<p>Make it executable</p>
<pre>chmod 755 /etc/cron.daily/yum_update.sh</pre>
<g:plusone href="http://lifelinux.com/auto-update-centos-server-with-yum-command/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/auto-update-centos-server-with-yum-command/">Auto Update CentOS Server With yum Command</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/auto-update-centos-server-with-yum-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Delete Files Older Than x Days</title>
		<link>http://lifelinux.com/delete-files-older-than-x-days/</link>
					<comments>http://lifelinux.com/delete-files-older-than-x-days/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 23 Nov 2010 08:38:33 +0000</pubDate>
				<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[delete file on linux]]></category>
		<category><![CDATA[delete files older]]></category>
		<category><![CDATA[delete old file order n day]]></category>
		<category><![CDATA[rm command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=45</guid>

					<description><![CDATA[<p>The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them. Command Syntax: find /path/to/files* -mtime [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://lifelinux.com/delete-files-older-than-x-days/">Delete Files Older Than x Days</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>The find utility on <strong>linux</strong> allows you to pass in a bunch of  interesting arguments, including one to execute another command on each  file. We’ll use this in order to figure out what files are older than a  certain number of days, and then use the rm command to delete them.<span id="more-45"></span></p>
<p><strong>Command Syntax:</strong></p>
<pre>find /path/to/files* -mtime  x -exec rm {} ;</pre>
<p>Note that there are spaces between rm, {}, and ;</p>
<p><strong>Example:</strong></p>
<pre>find /path/to/files* -mtime +7 -exec rm {} ;</pre>
<p><strong>Explanation:</strong></p>
<ul>
<li>The first argument is the path to the files. This can be a path, a  directory, or a wildcard as in the example above. I would recommend  using the full path, and make sure that you run the command without the  exec rm to make sure you are getting the right results.</li>
<li>The second argument, -mtime, is used to specify the number of days  old that the file is. If you enter +7, it will find files older than 7  days.</li>
<li>The third argument, -exec, allows you to pass in a command such as rm. The {} ; at the end is required to end the command.</li>
</ul>
<p>This should work on Ubuntu, Suse, Redhat, CentOS or pretty much any version of linux.</p>
<p><strong>More:</strong></p>
<p>If you happen to get an error:</p>
<pre>/usr/bin/find argument list too long</pre>
<p>You try again with the following command:</p>
<pre>find /path/to/files* -type f -mtime +7 -print 0 | xargs -0 -rm</pre>
<g:plusone href="http://lifelinux.com/delete-files-older-than-x-days/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="http://lifelinux.com/delete-files-older-than-x-days/">Delete Files Older Than x Days</a> appeared first on <a rel="nofollow" href="http://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://lifelinux.com/delete-files-older-than-x-days/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
