<?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>Linux Certification</title>
	<atom:link href="http://lpilinux.com/feed" rel="self" type="application/rss+xml" />
	<link>http://lpilinux.com</link>
	<description>LPI Certification - What, Why, and How</description>
	<lastBuildDate>Sat, 28 Aug 2010 07:02:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>uCertify&#8217;s Back 2 School Sale : Save 40%</title>
		<link>http://lpilinux.com/ucertifys-back-2-school-sale-save-40.html</link>
		<comments>http://lpilinux.com/ucertifys-back-2-school-sale-save-40.html#comments</comments>
		<pubDate>Sat, 28 Aug 2010 07:02:54 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://lpilinux.com/ucertifys-back-2-school-sale-save-40.html</guid>
		<description><![CDATA[Guys,uCertify is offering a 40% discount on all Prepkits. A user can select from extensive selection of over 300 PrepKits to help prepare for their IT certification exam(s). For a limited time only, uCertify is offering a humongous 40% discount! Buy any two PrepKits for $139.99 (compare to about $119.99 for each PrepKit!).
This time you [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fucertifys-back-2-school-sale-save-40.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fucertifys-back-2-school-sale-save-40.html" height="61" width="51" /></a></div><p>Guys,uCertify is offering a 40% discount on all Prepkits. A user can select from extensive selection of over 300 PrepKits to help prepare for their IT certification exam(s). For a limited time only, uCertify is offering a humongous 40% discount! Buy any two PrepKits for $139.99 (compare to about $119.99 for each PrepKit!).</p>
<p>This time you can also take advantage of an additional discount by joining us on Facebook! All anyone have to do is like our page to be entitled to this private discount.</p>
<p><a href="http://www.facebook.com/pages/ucertify/176752623633?v=app_4949752878" target="_blank">http://www.facebook.com/pages/ucertify/176752623633?v=app_4949752878</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fucertifys-back-2-school-sale-save-40.html&amp;linkname=uCertify%26%238217%3Bs%20Back%202%20School%20Sale%20%3A%20Save%2040%25" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/ucertifys-back-2-school-sale-save-40.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Tips for the day</title>
		<link>http://lpilinux.com/ssh-tips-for-the-day.html</link>
		<comments>http://lpilinux.com/ssh-tips-for-the-day.html#comments</comments>
		<pubDate>Sat, 03 Jul 2010 12:25:51 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Linux Tricks]]></category>

		<guid isPermaLink="false">http://lpilinux.com/ssh-tips-for-the-day.html</guid>
		<description><![CDATA[&#8216;When you are forwarding ports through a tunnel, either locally or remotely (i.e., with the -L or -R switches), you can modify the session real-time. The way that you do this is after you start the session, you press SHIFT + ` + c (The ` key also has a ~ in it, which is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fssh-tips-for-the-day.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fssh-tips-for-the-day.html" height="61" width="51" /></a></div><p>&#8216;When you are forwarding ports through a tunnel, either locally or remotely (i.e., with the -L or -R switches), you can modify the session real-time. The way that you do this is after you start the session, you press SHIFT + ` + c (The ` key also has a ~ in it, which is the actual keypress sent to the session). If it doesn’t work the first time, press ENTER a couple of times and try it again. Once you get the “ssh>” prompt, type “?” for the commands you can put in. Here’s an example session:</p>
<p>[0908][scott@dev:~]$ ssh -R 8080:suseblog.com:8080 scott@suseblog.com<br />
Password:<br />
Last login: Thu Oct 15 11:59:43 2009 from 67.214.232.162<br />
Have a lot of fun&#8230;<br />
[1109][scott@mail:~]$ [PRESS SHIFT + ` + c HERE]<br />
ssh> ?<br />
Commands:<br />
      -L[bind_address:]port:host:hostport    Request local forward<br />
      -R[bind_address:]port:host:hostport    Request remote forward<br />
      -KR[bind_address:]port                 Cancel remote forward<br />
[PRESS ENTER HERE]<br />
[1110][scott@mail:~]$ [PRESS SHIFT + ` + c HERE]<br />
ssh> -R8080:letslearnlinux.com:1080<br />
Forwarding port.</p>
<p>[1110][scott@mail:~]$&#8217;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fssh-tips-for-the-day.html&amp;linkname=SSH%20Tips%20for%20the%20day" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/ssh-tips-for-the-day.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cropping Multiple Images in the Same Way</title>
		<link>http://lpilinux.com/cropping-multiple-images-in-the-same-way.html</link>
		<comments>http://lpilinux.com/cropping-multiple-images-in-the-same-way.html#comments</comments>
		<pubDate>Sat, 03 Jul 2010 12:21:17 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Important for LPI 117-101]]></category>

		<guid isPermaLink="false">http://lpilinux.com/cropping-multiple-images-in-the-same-way.html</guid>
		<description><![CDATA[&#8216;Getting the right cropping values using GIMP
In 5 steps:
Where to find the cropping values
1. Open up GIMP.
2. Open one of the images in GIMP.
3. Using the Rectangle Select Tool (hotkey &#8220;R&#8221;), select the area you want to be cropped.
4. Note the X, Y, Width and Height values GIMP gives you (have a look at the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fcropping-multiple-images-in-the-same-way.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fcropping-multiple-images-in-the-same-way.html" height="61" width="51" /></a></div><p>&#8216;Getting the right cropping values using GIMP</p>
<p>In 5 steps:<br />
Where to find the cropping values<br />
1. Open up GIMP.<br />
2. Open one of the images in GIMP.<br />
3. Using the Rectangle Select Tool (hotkey &#8220;R&#8221;), select the area you want to be cropped.<br />
4. Note the X, Y, Width and Height values GIMP gives you (have a look at the picture, you can find them in the GIMP main window).<br />
5. Close GIMP (or leave it open if you plan to use it again soon).</p>
<p>We now have the values we need to tell the mogrify utility what to crop. Let&#8217;s go on and write a line that&#8217;ll execute mogrify in such a way that it&#8217;ll crop all our images!<br />
Cropping the images</p>
<p>Now we&#8217;ll start working in the terminal. Open up your favourite one and cd to the directory where the images are located. Note that I strongly recommend having only the images that are to be cropped in the directory, nothing more. It saves you a lot of trouble. Well then, let&#8217;s start with the mogrify command. The syntax for cropping is as follows:</p>
<p>    [rechosen@localhost ~]$ mogrify -crop {Width}x{Height}+{X}+{Y} image.png</p>
<p>Now don&#8217;t be scared, the {Width}, {Height} and so on simply are the places where you should put the values you got from GIMP! Note that I use a png file as an example, while mogrify is able to handle over 100 image file types. You don&#8217;t have to use png files with it. Anyway, if I&#8217;d fill in the values from the screenshot, the mogrify command would look like this:</p>
<p>    [rechosen@localhost ~]$ mogrify -crop 643&#215;393+7+83 image.png</p>
<p>The logic behind this system is the following: crop an area of 643 by 393 pixels, starting at 7 pixels from the left and 83 pixels from the top of the image. Got it? Ok then. The above command would overwrite image.png with a cropped version. But this still manipulates just a single image. The easiest way to make mogrify modify all images is just this:</p>
<p>    [rechosen@localhost ~]$ mogrify -crop 643&#215;393+7+83 *.png</p>
<p>The asterisk makes bash fill in all png files in the current directory, and mogrify will handle them all happily. After a (hopefully short) wait, all the images will have been cropped. If you want to crop images of an other format, just change &#8220;*.png&#8221; to, for example, &#8220;*.jpg&#8221; or &#8220;*.gif&#8221;.</p>
<p>You might want to give the cropped images other names, so that the original images will not be overwritten and it will be clear which images have been cropped and which haven&#8217;t. This is more complex, but hey, we&#8217;re working on Linux! Everything is possible if you take the time to write it.<br />
Renaming the cropped images</p>
<p>In order to give the cropped images other names, we&#8217;ll use a bash loop. This time, we&#8217;ll use the convert utility. It is from the same family as mogrify, but it makes it easier for us to output to an other filename. I won&#8217;t explain the whole loop, as most of it is bash knowledge, but I will tell you which things you can/should alter to get the right results. There are loops for two cases, just pick the one of which you like the file naming the most.</p>
<p>    * Case 1: You want the output files to be named like this: originalfile.png => cropped_originalfile.png (again, you can insert any of the over 100 supported image formats here, I just like png). The loop should be like this:</p>
<p>          [rechosen@localhost ~]$ for file in *.png; do convert -crop {Width}x{Height}+{X}+{Y} $file cropped_$file; done</p>
<p>      You should replace &#8220;png&#8221; with the extension you want (think of jpg, gif, png (of course) and so on), and the &#8220;{Width}&#8221;, &#8220;{Height}&#8221; etc with the values you got from GIMP. You may also replace &#8220;cropped_&#8221; with any prefix you like.<br />
    * Case 2: You want the output files to be named like this: originalfile.png => originalfile_cropped.png (or originalfile.jpg => originalfile_cropped.jpg, you name it). In that case, you should use the following loop:</p>
<p>          [rechosen@localhost ~]$ for file in *.png; do convert -crop {Width}x{Height}+{X}+{Y} $file ${file%.png}_cropped.png; done</p>
<p>      Again, replace &#8220;png&#8221; with the extension you want (watch it, there are 3 instances of it) and the &#8220;{Width}&#8221;, &#8220;{Height}&#8221; etc with the values you got from GIMP. You can also replace &#8220;_cropped&#8221; with any suffix you like.</p>
<p>      Note that you can, in this case, easily modify the output format: if you want to output the cropped images in jpg format, you can just replace the third instance of &#8220;png&#8221; with &#8220;jpg&#8221;, no matter what format your input files are. The convert utility will detect it and change the image format automatically. &#8216;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fcropping-multiple-images-in-the-same-way.html&amp;linkname=Cropping%20Multiple%20Images%20in%20the%20Same%20Way" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/cropping-multiple-images-in-the-same-way.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an mpeg with mencoder that plays on Windows Media Player</title>
		<link>http://lpilinux.com/creating-an-mpeg-with-mencoder-that-plays-on-windows-media-player.html</link>
		<comments>http://lpilinux.com/creating-an-mpeg-with-mencoder-that-plays-on-windows-media-player.html#comments</comments>
		<pubDate>Sat, 03 Jul 2010 12:20:14 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Important for LPI 117-101]]></category>

		<guid isPermaLink="false">http://lpilinux.com/creating-an-mpeg-with-mencoder-that-plays-on-windows-media-player.html</guid>
		<description><![CDATA[&#8216;Let&#8217;s have a look at a rather simple mencoder command that should create a WMP-compatible MPEG file:
    [rechosen@localhost ~]$ mencoder
 -oac lavc -ovc lavc -lavcopts acodec=mp2:vcodec=mpeg2video:mbd=1:vbitrate=1800 -of mpeg -o 
Replace &#8220;
&#8221; with the video source (for example a file or a DVD scene) and &#8220;&#8221; with the file you want the output [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fcreating-an-mpeg-with-mencoder-that-plays-on-windows-media-player.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fcreating-an-mpeg-with-mencoder-that-plays-on-windows-media-player.html" height="61" width="51" /></a></div><p>&#8216;Let&#8217;s have a look at a rather simple mencoder command that should create a WMP-compatible MPEG file:</p>
<p>    [rechosen@localhost ~]$ mencoder<br />
<input /> -oac lavc -ovc lavc -lavcopts acodec=mp2:vcodec=mpeg2video:mbd=1:vbitrate=1800 -of mpeg -o <outputfile></p>
<p>Replace &#8220;<br />
<input />&#8221; with the video source (for example a file or a DVD scene) and &#8220;</outputfile><outputfile>&#8221; with the file you want the output to be written to (e.g. &#8220;samplemovie.mpg&#8221; or &#8220;dvdbackup.mpeg&#8221;). You can also replace the value after &#8220;vbitrate=&#8221; with a higher or lower bitrate, depending on the desired quality of the outputfile (you could also leave it away entirely, but it will then default to 800, which is quite low and therefore pretty much only suitable for very low resolution movies).</p>
<p>Note that the above example will try to encode the movie at the same resolution and fps as the source. However, this does not always work correctly and also isn&#8217;t always what you want. Furthermore, the above example doesn&#8217;t use two-pass encoding. Two-pass encoding is useful because it results in a higher quality outputfile with about the same size (it needs to read the source twice, though).<br />
A more feature-rich example</p>
<p>The next example features rescaling (adapting the resolution), specifies a framerate for the outputfile and encodes in two passes.</p>
<p>    [rechosen@localhost ~]$ for i in {1,2}; do mencoder<br />
<input /> -oac lavc -ovc lavc -lavcopts acodec=mp2:vcodec=mpeg2video:mbd=1:vpass=$i:vbitrate=1800 -of mpeg -ofps 25 -vf scale=640:480 -o </outputfile><outputfile>; done</p>
<p>Replace &#8220;<br />
<input />&#8221; with any source that can be read twice (a file or a DVD scene) and &#8220;</outputfile><outputfile>&#8221; with the file you want the encoded data to be written to. You can alter the values after &#8220;-ofps=&#8221; and &#8220;-vf scale=&#8221; to change the framerate and the resolution of the outputfile, respectively (and of course you can alter the vbitrate again, too).</p>
<p>One more handy trick: you can set only the width of the encoded video and let mencoder determine the height, keeping the right aspect ratio:</p>
<p>    [rechosen@localhost ~]$ for i in {1,2}; do mencoder<br />
<input /> -oac lavc -ovc lavc -lavcopts acodec=mp2:vcodec=mpeg2video:mbd=1:vpass=$i:vbitrate=1800 -of mpeg -ofps 25 -vf scale -zoom -xy 640 -o </outputfile><outputfile>; done</p>
<p>Again, replace &#8220;<br />
<input />&#8221; with any source that can be read twice (a file or a DVD scene) and &#8220;</outputfile><outputfile>&#8221; with the file you want the encoded data to be written to. You can alter the value after &#8220;-ofps=&#8221; again to change the framerate of the outputted data, and after &#8220;-zoom -xy &#8221; is the value to change if you want a different width (note that values less than or equal to 8 will be interpreted as scaling factors, not as the width of the outputted video).&#8217;</outputfile></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fcreating-an-mpeg-with-mencoder-that-plays-on-windows-media-player.html&amp;linkname=Creating%20an%20mpeg%20with%20mencoder%20that%20plays%20on%20Windows%20Media%20Player" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/creating-an-mpeg-with-mencoder-that-plays-on-windows-media-player.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If Condition in Bash Script</title>
		<link>http://lpilinux.com/if-condition-in-bash-script.html</link>
		<comments>http://lpilinux.com/if-condition-in-bash-script.html#comments</comments>
		<pubDate>Sat, 03 Jul 2010 12:19:12 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Important for LPI 117-101]]></category>

		<guid isPermaLink="false">http://lpilinux.com/if-condition-in-bash-script.html</guid>
		<description><![CDATA[&#8216;If you use bash for scripting you will undoubtedly have to use conditions a lot, for example for an if &#8230; then construct or a while loop. The syntax of these conditions can seem a bit daunting to learn and use. This tutorial aims to help the reader understanding conditions in bash, and provides a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fif-condition-in-bash-script.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fif-condition-in-bash-script.html" height="61" width="51" /></a></div><p>&#8216;If you use bash for scripting you will undoubtedly have to use conditions a lot, for example for an if &#8230; then construct or a while loop. The syntax of these conditions can seem a bit daunting to learn and use. This tutorial aims to help the reader understanding conditions in bash, and provides a comprehensive list of the possibilities. A small amount of general shell knowledge is assumed.</p>
<p>Difficulty: Basic &#8211; Medium<br />
Introduction</p>
<p>Bash features a lot of built-in checks and comparisons, coming in quite handy in many situations. You&#8217;ve probably seen if statements like the following before:</p>
<p>    if [ $foo -ge 3 ]; then</p>
<p>The condition in this example is essentially a command. It may sound strange, but surrounding a comparison with square brackets is the same as using the built-in test command, like this:</p>
<p>    if test $foo -ge 3; then</p>
<p>If $foo is Greater then or Equal to 3, the block after &#8216;then&#8217; will be executed. If you always wondered why bash tends to use -ge or -eq instead of >= or ==, it&#8217;s because this condition type originates from a command, where -ge and -eq are options.<br />
And that&#8217;s what if does essentially, checking the exit status of a command. I&#8217;ll explain that in more detail further in the tutorial.<br />
There also are built-in checks that are more specific to shells. What<br />
about this one?</p>
<p>    if [ -f regularfile ]; then</p>
<p>The above condition is true if the file &#8216;regularfile&#8217; exists and<br />
is a regular file. A regular file means that it&#8217;s not a block or<br />
character device, or a directory. This way, you can make sure a usable<br />
file exists before doing something with it. You can even check if a<br />
file is readable!</p>
<p>    if [ -r readablefile]; then</p>
<p>The above condition is true if the file &#8216;readablefile&#8217; exists and is readable. Easy, isn&#8217;t it?<br />
The syntax of an if statement (a short explanation)</p>
<p>The basic syntax of an if &#8230; then statement is like this:</p>
<p>    if <condition>; then<br />
    <commands><br />
    fi</p>
<p>The condition is, depending on its type, surrounded by certain<br />
brackets, eg. [ ]. You can read about the different types further on<br />
in the tutorial. You can add commands to be executed when the condition is false using the else keyword, and use the elif (elseif) keyword to execute commands on another condition if the primary condition is false. The else keyword always comes last. Example:</p>
<p>    if [ -r somefile ]; then<br />
    content=$(cat somefile)<br />
    elif [ -f somefile ]; then<br />
    echo &#8220;The file &#8217;somefile&#8217; exists but is not readable to the script.&#8221;<br />
    else<br />
    echo &#8220;The file &#8217;somefile&#8217; does not exist.&#8221;<br />
    fi</p>
<p>A short explanation of the example: first we check if the file somefile is readable (&#8221;if [ -r somefile ]&#8220;). If so, we read it into a variable. If not, we check if it actually exists (&#8221;elif [ -f somefile ]&#8220;). If that&#8217;s true, we report that it exists but isn&#8217;t readable (if it was, we would have read the content). If the file doesn&#8217;t exist, we report so, too. The condition at elif is only executed if the condition at if was false. The commands belonging to else are only executed if both conditions are false.<br />
The basic rules of conditions</p>
<p>When you start writing and using your own conditions, there are some rules you should know to prevent getting errors that are hard to trace. Here follow three important ones:</p>
<p>   1. Always keep spaces between the brackets and the actual check/comparison. The following won&#8217;t work:</p>
<p>          if [$foo -ge 3]; then</p>
<p>      Bash will complain about a &#8220;missing `]&#8217;&#8221;.<br />
   2. Always terminate the line before putting a new keyword like &#8220;then&#8221;. The words if, then, else, elif and fi are shell keywords, meaning that they cannot share the same line. Put a &#8220;;&#8221; between the previous statement and the keyword or place the keyword on the start of a new line. Bash will throw errors like &#8220;syntax error near unexpected token `fi&#8217;&#8221; if you don&#8217;t.<br />
   3. It is a good habit to quote string variables if you use them in conditions, because otherwise they are likely to give trouble if they contain<br />
      spaces and/or newlines. By quoting I mean:</p>
<p>          if [ "$stringvar" == "tux" ]; then</p>
<p>      There are a few cases in which you should not<br />
      quote, but they are rare. You will see one of them further on in the tutorial. </p>
<p>Also, there are two things that may be useful to know:</p>
<p>   1. You can invert a condition by putting an &#8220;!&#8221; in front of it. Example:</p>
<p>          if [ ! -f regularfile ]; then</p>
<p>      Be sure to place the &#8220;!&#8221; inside the brackets!<br />
   2. You can combine conditions by using certain operators. For the single-bracket syntax that we&#8217;ve been using so far, you can use &#8220;-a&#8221; for and and &#8220;-o&#8221; for or. Example:</p>
<p>          if [ $foo -ge 3 -a $foo -lt 10 ]; then</p>
<p>      The above condition will return true if $foo contains an integer greater than or equal to 3 and Less Than 10. You can read more about these combining expressions at the respective condition syntaxes. </p>
<p>And, one more basic thing: don&#8217;t forget that conditions can also be used in other statements, like while and until. It is outside the scope of this tutorial to explain those, but you can read about them at the Bash Guide for Beginners.</p>
<p>Anyway, I&#8217;ve only shown you conditions between single brackets so far. There are more syntaxes, however, as you will read in the next section.<br />
Different condition syntaxes</p>
<p>Bash features different syntaxes for conditions. I will list the three of them:<br />
1. Single-bracket syntax</p>
<p>This is the condition syntax you have already seen in the previous paragraphs; it&#8217;s the oldest supported syntax. It supports three types of conditions:</p>
<p>    * File-based conditions<br />
          o Allows different kinds of checks on a file. Example:</p>
<p>                if [ -L symboliclink ]; then</p>
<p>            The above condition is true if the file &#8217;symboliclink&#8217; exists and is a symbolic link. For more file-based conditions see the table below.<br />
    * String-based conditions<br />
          o Allows checks on a string and comparing of strings. Example one:</p>
<p>                if [ -z "$emptystring" ]; then</p>
<p>            The above condition is true if $emptystring is an empty string or an uninitialized variable. Example two:</p>
<p>                if [ "$stringvar1" == "cheese" ]; then</p>
<p>            The above condition is true if $stringvar1 contains just the string &#8220;cheese&#8221;. For more string-based conditions see the table below.<br />
    * Arithmetic (number-based) conditions<br />
          o Allows comparing integer numbers. Example:</p>
<p>                if [ $num -lt 1 ]; then</p>
<p>            The above condition returns true if $num is less than 1. For more arithmetic conditions see the table below. </p>
<p>2. Double-bracket syntax</p>
<p>You may have encountered conditions enclosed in double square brackets already, which look like this:</p>
<p>    if [[ "$stringvar" == *string* ]]; then</p>
<p>The double-bracket syntax serves as an enhanced version of the single-bracket syntax; it mainly has the same features, but also some important differences with it. I will list them here:</p>
<p>    * The first difference can be seen in the above example; when comparing strings, the double-bracket syntax features shell globbing. This means that an asterisk (&#8221;*&#8221;) will expand to literally anything, just as you probably know from normal command-line usage. Therefore, if $stringvar contains the phrase &#8220;string&#8221; anywhere, the condition will return true. Other forms of shell globbing are allowed, too. If you&#8217;d like to match both &#8220;String&#8221; and &#8220;string&#8221;, you could use the following syntax:</p>
<p>          if [[ "$stringvar" == *[sS]tring* ]]; then</p>
<p>      Note that only general shell globbing is allowed. Bash-specific things like {1..4} or {foo,bar} will not work. Also note that the globbing will not work if you quote the right string. In this case you should leave it unquoted.<br />
    * The second difference is that word splitting is prevented. Therefore, you could omit placing quotes around string variables and use a condition like the following without problems:</p>
<p>          if [[ $stringvarwithspaces != foo ]]; then</p>
<p>      Nevertheless, the quoting string variables remains a good habit, so I recommend just to keep doing it.<br />
    * The third difference consists of not expanding filenames. I will illustrate this difference using two examples, starting with the old single-bracket situation:</p>
<p>          if [ -a *.sh ]; then</p>
<p>      The above condition will return true if there is one single file in the working directory that has a .sh extension. If there are none, it will return false. If there are several .sh files, bash will throw an error and stop executing the script. This is because *.sh is expanded to the files in the working directory. Using double brackets prevents this:</p>
<p>          if [[ -a *.sh ]]; then</p>
<p>      The above condition will return true only if there is a file in the working directory called &#8220;*.sh&#8221;, no matter what other .sh files exist. The asterisk is taken literally, because the double-bracket syntax does not expand filenames.<br />
    * The fourth difference is the addition of more generally known combining expressions, or, more specific, the operators &#8220;&#038;&#038;&#8221; and &#8220;||&#8221;. Example:</p>
<p>          if [[ $num -eq 3 &#038;&#038; "$stringvar" == foo ]]; then</p>
<p>      The above condition returns true if $num is equal to 3 and $stringvar is equal to &#8220;foo&#8221;. The -a and -o known from the single-bracket syntax is supported, too.</p>
<p>      Note that the and operator has precedence over the or operator, meaning that &#8220;&#038;&#038;&#8221; or &#8220;-a&#8221; will be evaluated before &#8220;||&#8221; or &#8220;-o&#8221;.<br />
    * The fifth difference is that the double-bracket syntax allows regex pattern matching using the &#8220;=~&#8221; operator. See the table for more information.</p>
<p>3. Double-parenthesis syntax</p>
<p>There also is another syntax for arithmetic (number-based) conditions, most likely adopted from the Korn shell:</p>
<p>    if (( $num < = 5 )); then</p>
<p>The above condition is true if $num is less than or equal to 5. This syntax may seem more familiar to programmers. It features all the 'normal' operators, like "==", "<" and ">=&#8221;. It supports the &#8220;&#038;&#038;&#8221; and &#8220;||&#8221; combining expressions (but not the -a and -o ones!). It is equivalent to the built-in let command.<br />
Table of conditions</p>
<p>The following table list the condition possibilities for both the single- and the double-bracket syntax. Save a single exception, the examples are given in single-bracket syntax, but are always compatible with double brackets.<br />
 1. File-based conditions:<br />
Condition 	True if 	Example/explanation<br />
[ -a existingfile ] 	file &#8216;existingfile&#8217; exists. 	if [ -a tmp.tmp ]; then<br />
    rm -f tmp.tmp # Make sure we&#8217;re not bothered by an old temporary file<br />
fi<br />
[ -b blockspecialfile ] 	file &#8216;blockspecialfile&#8217; exists and is block special. 	Block special files are special kernel files found in /dev, mainly used for ATA devices like hard disks, cd-roms and floppy disks.</p>
<p>if [ -b /dev/fd0 ]; then<br />
    dd if=floppy.img of=/dev/fd0 # Write an image to a floppy<br />
fi<br />
[ -c characterspecialfile ] 	file &#8216;characterspecialfile&#8217; exists and is character special. 	Character special files are special kernel files found in /dev, used for all kinds of purposes (audio hardware, tty&#8217;s, but also /dev/null).</p>
<p>if [ -c /dev/dsp ]; then<br />
    cat raw.wav > /dev/dsp # This actually works for certain raw wav files<br />
fi<br />
[ -d directory ] 	file &#8216;directory&#8217; exists and is a directory. 	In UNIX-style, directories are a special kind of file.</p>
<p>if [ -d ~/.kde ]; then<br />
    echo &#8220;You seem to be a kde user.&#8221;<br />
fi<br />
[ -e existingfile ] 	file &#8216;existingfile&#8217; exists. 	(same as -a, see that entry for an example)<br />
[ -f regularfile ] 	file &#8216;regularfile&#8217; exists and is a regular file. 	A regular file is neither a block or character special file nor a directory.</p>
<p>if [ -f ~/.bashrc ]; then<br />
    source ~/.bashrc<br />
fi<br />
[ -g sgidfile ] 	file &#8217;sgidfile&#8217; exists and is set-group-ID. 	When the SGID-bit is set on a directory, all files created in that directory will inherit the group of the directory.</p>
<p>if [ -g . ]; then<br />
   echo &#8220;Created files are inheriting the group &#8216;$(ls -ld . | awk &#8216;{ print $4 }&#8217;)&#8217; from the working directory.&#8221;<br />
fi<br />
[ -G fileownedbyeffectivegroup ] 	file &#8216;fileownedbyeffectivegroup&#8217; exists and is owned by the effective group ID. 	The effective group id is the primary group id of the executing user.</p>
<p>if [ ! -G file ]; then # An exclamation mark inverts the outcome of the condition following it<br />
   chgrp $(id -g) file # Change the group if it&#8217;s not the effective one<br />
fi<br />
[ -h symboliclink ] 	file &#8217;symboliclink&#8217; exists and is a symbolic link. 	if [ -h $pathtofile ]; then<br />
    pathtofile=$(readlink -e $pathtofile) # Make sure $pathtofile contains the actual file and not a symlink to it<br />
fi<br />
[ -k stickyfile ] 	file &#8217;stickyfile&#8217; exists and has its sticky bit set. 	The sticky bit has got quite a history, but is now used to prevent world-writable directories from having their contents deletable by anyone.</p>
<p>if [ ! -k /tmp ]; then # An exclamation mark inverts the outcome of the condition following it<br />
    echo &#8220;Warning! Anyone can delete and/or rename your files in /tmp!&#8221;<br />
fi<br />
[ -L symboliclink ] 	file &#8217;symboliclink&#8217; exists and is a symbolic link. 	(same as -h, see that entry for an example)<br />
[ -N modifiedsincelastread ] 	file &#8216;modifiedsincelastread&#8217; exists and was modified after the last read. 	if [ -N /etc/crontab ]; then<br />
    killall -HUP crond # SIGHUP makes crond reread all crontabs<br />
fi<br />
[ -O fileownedbyeffectiveuser ] 	file &#8216;fileownedbyeffectiveuser&#8217; exists and is owned by the user executing the script. 	if [ -O file ]; then<br />
    chmod 600 file # Makes the file private, which is a bad idea if you don&#8217;t own it<br />
fi<br />
[ -p namedpipe ] 	file &#8216;namedpipe&#8217; exists and is a named pipe. 	A named pipe is a file in /dev/fd/ that can be read just once. See my bash tutorial for a case in which it&#8217;s used.</p>
<p>if [ -p $file ]; then<br />
    cp $file tmp.tmp # Make sure we&#8217;ll be able to read<br />
    file=&#8221;tmp.tmp&#8221;    # the file as many times as we like<br />
fi<br />
[ -r readablefile ] 	file &#8216;readablefile&#8217; exists and is readable to the script. 	if [-r file ]; then<br />
    content=$(cat file) # Set $content to the content of the file<br />
fi<br />
[ -s nonemptyfile ] 	file &#8216;nonemptyfile&#8217; exists and has a size of more than 0 bytes. 	if [ -s logfile ]; then<br />
    gzip logfile    # Backup the old logfile<br />
    touch logfile # before creating a fresh one.<br />
fi<br />
[ -S socket ] 	file &#8217;socket&#8217; exists and is a socket. 	A socket file is used for inter-process communication, and features an interface similar to a network connection.</p>
<p>if [ -S /var/lib/mysql/mysql.sock ]; then<br />
    mysql &#8211;socket=/var/lib/mysql/mysql.sock # See this MySQL tip<br />
fi<br />
[ -t openterminal ] 	file descriptor &#8216;openterminal&#8217; exists and refers to an open terminal. 	Virtually everything is done using files on Linux/UNIX, and the terminal is no exception.</p>
<p>if [ -t /dev/pts/3 ]; then<br />
    echo -e &#8220;\nHello there. Message from terminal $(tty) to you.&#8221; > /dev/pts/3 # Anyone using that terminal will actually see this message!<br />
fi<br />
[ -u suidfile ] 	file &#8217;suidfile&#8217; exists and is set-user-ID. 	Setting the suid-bit on a file causes execution of that file to be done with the credentials of the owner of the file, not of the executing user.</p>
<p>if [ -u executable ]; then<br />
    echo &#8220;Running program executable as user $(ls -l executable | awk &#8216;{ print $3 }&#8217;).&#8221;<br />
fi<br />
[ -w writeablefile ] 	file &#8216;writeablefile&#8217; exists and is writeable to the script. 	if [ -w /dev/hda ]; then<br />
    grub-install /dev/hda<br />
fi<br />
[ -x executablefile ] 	file &#8216;executablefile&#8217; exists and is executable for the script. 	Note that the execute permission on a directory means that it&#8217;s searchable (you can see which files it contains).</p>
<p>if [ -x /root ]; then<br />
    echo &#8220;You can view the contents of the /root directory.&#8221;<br />
fi<br />
[ newerfile -nt olderfile ] 	file &#8216;newerfile&#8217; was changed more recently than &#8216;olderfile&#8217;, or if &#8216;newerfile&#8217; exists and &#8216;olderfile&#8217; doesn&#8217;t. 	if [ story.txt1 -nt story.txt ]; then<br />
    echo &#8220;story.txt1 is newer than story.txt; I suggest continuing with the former.&#8221;<br />
fi<br />
[ olderfile -ot newerfile ] 	file &#8216;olderfile&#8217; was changed longer ago than &#8216;newerfile&#8217;, or if &#8216;newerfile&#8217; exists and &#8216;olderfile&#8217; doesn&#8217;t. 	if [ /mnt/remote/remotefile -ot localfile ]; then<br />
    cp -f localfile /mnt/remote/remotefile # Make sure the remote location has the newest version of the file, too<br />
fi<br />
[ same -ef file ] 	file &#8217;same&#8217; and file &#8216;file&#8217; refer to the same device/inode number. 	if [ /dev/cdrom -ef /dev/dvd ]; then<br />
    echo &#8220;Your primary cd drive appears to read dvd&#8217;s, too.&#8221;<br />
fi<br />
 2. String-based conditions:<br />
Condition 	True if 	Example/explanation<br />
[ STRING1 == STRING2 ] 	STRING1 is equal to STRING2. 	if [ "$1" == "moo" ]; then<br />
    echo $cow # Ever tried executing &#8216;apt-get moo&#8217;?<br />
fi</p>
<p>Note: you can also use a single &#8220;=&#8221; instead of a double one.<br />
[ STRING1 != STRING2 ] 	STRING1 is not equal to STRING2. 	if [ "$userinput" != "$password" ]; then<br />
    echo &#8220;Access denied! Wrong password!&#8221;<br />
    exit 1 # Stops script execution right here<br />
fi<br />
[ STRING1 \> STRING2 ] 	STRING1 sorts after STRING2 in the current locale (lexographically). 	The backslash before the angle bracket is there because the bracket needs to be escaped to be interpreted correctly. As an example we have a basic bubble sort:</p>
<p>(Don&#8217;t feel ashamed if you don&#8217;t understand this, it is a more complex example)</p>
<p>array=( linux tutorial blog )<br />
swaps=1<br />
while (( swaps > 0 )); do</p>
<p>swaps=0<br />
    for (( i=0; i < (( ${#array[@]} - 1 )) ; i++ )); do<br />
        if [ "${array[$i]}" \> &#8220;${array[$(( i + 1 ))]}&#8221; ]; then # Here is the sorting condition<br />
            tempstring=${array[$i]}<br />
            array[$i]=${array[$(( i + 1 ))]}<br />
            array[$(( i + 1 ))]=$tempstring<br />
            (( swaps=swaps + 1 ))<br />
        fi<br />
    done<br />
done<br />
echo ${array[@]} # Returns &#8220;blog linux tutorial&#8221;<br />
[ STRING1 \< STRING2 ] 	STRING1 sorts before STRING2 in the current locale (lexographically).<br />
[ -n NONEMPTYSTRING ] 	NONEMPTYSTRING has a length of more than zero. 	This condition only accepts valid strings, so be sure to quote anything you give to it.</p>
<p>if [ -n "$userinput" ]; then<br />
    userinput=parse($userinput) # Only parse if the user actually gave some input.<br />
fi</p>
<p>Note that you can also omit the &#8220;-n&#8221;, as brackets with just a string in it behave the same.<br />
[ -z EMPTYSTRING ] 	EMPTYSTRING is an empty string. 	This condition also accepts non-string input, like an uninitialized variable:</p>
<p>if [ -z $uninitializedvar ]; then<br />
    uninitializedvar=&#8221;initialized&#8221; # -z returns true on an uninitialized variable, so we initialize it here.<br />
fi<br />
Double-bracket syntax only:<br />
[[ STRING1 =~ REGEXPATTERN ]] 	STRING1 matches REGEXPATTERN. 	If you are familiar with Regular Expressions, you can use this conditions to perform a regex match.</p>
<p>if [[ "$email" =~ "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}\b&#8221; ]]; then<br />
    echo &#8220;\$email contains a valid e-mail address.&#8221;<br />
fi<br />
 3. Arithmetic (number-based) conditions:<br />
Condition 	True if 	Example/explanation<br />
[ NUM1 -eq NUM2 ] 	NUM1 is EQual to NUM2. 	These conditions only accept integer numbers. Strings will be converted to integer numbers, if possible. Some random examples:</p>
<p>if [ $? -eq 0 ]; then # $? returns the exit status of the previous command<br />
    echo &#8220;Previous command ran succesfully.&#8221;<br />
fi</p>
<p>if [ $(ps -p $pid -o ni=) -ne $(nice) ]; then<br />
    echo &#8220;Process $pid is running with a non-default nice value&#8221;<br />
fi</p>
<p>if [ $num -lt 0 ]; then<br />
    echo &#8220;Negative numbers not allowed; exiting&#8230;&#8221;<br />
    exit 1<br />
fi<br />
[ NUM1 -ne NUM2 ] 	NUM1 is Not Equal to NUM2.<br />
[ NUM1 -gt NUM2 ] 	NUM1 is Greater Than NUM2.<br />
[ NUM1 -ge NUM2 ] 	NUM1 is Greater than or Equal to NUM2.<br />
[ NUM1 -lt NUM2 ] 	NUM1 is Less Than NUM2.<br />
[ NUM1 -le NUM2 ] 	NUM1 is Less than or Equal to NUM2.<br />
4. Miscellaneous conditions:<br />
Condition 	True if 	Example/explanation<br />
[ -o shelloption ] 	shell option &#8217;shelloption&#8217; is enabled. 	Shell options modify the behaviour of bash, except a few unmodifiable ones that indicate the shell status.</p>
<p>if [ ! -o checkwinsize ] # An exclamation mark inverts the outcome of the condition following it<br />
    echo &#8220;Shell option checkwinsize is disabled; enabling it so you can resize you terminal window without problems.&#8221;<br />
    shopt -s checkwinsize # This shell option is modifiable<br />
fi</p>
<p>if [ -o login_shell ]; then<br />
    echo &#8220;This a a login shell.&#8221; # This shell option is not modifiable</p>
<p>fi</p>
<p>With the double-parenthesis syntax, you can use the following conditions:<br />
5. Double-parenthesis syntax conditions:<br />
Condition 	True if 	Example/explanation<br />
(( NUM1 == NUM2 )) 	NUM1 is equal to NUM2. 	These conditions only accept integer numbers. Strings will be converted to integer numbers, if possible. Some random examples:</p>
<p>if (( $? == 0 )); then # $? returns the exit status of the previous command<br />
    echo &#8220;Previous command ran succesfully.&#8221;<br />
fi</p>
<p>if (( $(ps -p $pid -o ni=) != $(nice) )); then<br />
    echo &#8220;Process $pid is running with a non-default nice value&#8221;<br />
fi</p>
<p>if (( $num < 0 )); then<br />
    echo "Negative numbers not allowed; exiting..."<br />
    exit 1<br />
fi<br />
(( NUM1 != NUM2 )) 	NUM1 is not equal to NUM2.<br />
(( NUM1 > NUM2 )) 	NUM1 is greater than NUM2.<br />
(( NUM1 >= NUM2 )) 	NUM1 is greater than or equal to NUM2.<br />
(( NUM1 < NUM2 )) 	NUM1 is less than NUM2.<br />
(( NUM1 <= NUM2 )) 	NUM1 is less than or equal to NUM2.</p>
<p>After this dry information load, here's a bit of explanation for those who want to know more...<br />
Diving a little deeper</p>
<p>I said I'd tell more about the fact that if essentially checks the exit status of commands. And so I will. The basic rule of bash when it comes to conditions is 0 equals true, >0 equals false.<br />
That&#8217;s pretty much the opposite of many programming languages where 0 equals false and 1 (or more) equals true. The reason behind this is that shells like bash deal with programs a lot. By UNIX convention, programs use an exit status for indicating whether execution went alright or an error occured. As a succesful execution doesn&#8217;t require any explanation, it needs only one exit status. If there was a problem, however, it is useful to know what went wrong. Therefore, 0 is used for a succesful execution, and 1-255 to indicate what kind of error occured. The meaning of the numbers 1-255 differs depending on the program returning them.</p>
<p>Anyway, if executes the block after then when the command returns 0. Yes, conditions are commands. The phrase [ $foo -ge 3 ] returns an exit status, and the other two syntaxes as well! Therefore, there&#8217;s a neat trick you can use to quickly test a condition:</p>
<p>    [ $foo -ge 3 ] &#038;&#038; echo true</p>
<p>In this example, &#8220;echo true&#8221; is only executed if &#8220;[ $foo -ge 3 ]&#8221; returns 0 (true). Why is that, you might ask. It&#8217;s because bash only evaluates a condition when needed. When using the and combining expression, both conditions need to be true to make the combining expression return true. If the first condition returns false, it doesn&#8217;t matter what the second one returns; the result will be false. Therefore, bash doesn&#8217;t evaluate the second condition, and that&#8217;s the reason why &#8220;echo true&#8221; is not executed in the example. This is the same for the or operator (&#8221;||&#8221;), where the second condition is not evaluated if the first one is true.</p>
<p>Well, so much for the diving. If you want to know even more, I&#8217;d like to point you to the Advanced Bash-Scripting Guide and maybe the Bash Reference Manual.&#8217;</commands></condition></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fif-condition-in-bash-script.html&amp;linkname=If%20Condition%20in%20Bash%20Script" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/if-condition-in-bash-script.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is dump command?</title>
		<link>http://lpilinux.com/what-is-dump-command.html</link>
		<comments>http://lpilinux.com/what-is-dump-command.html#comments</comments>
		<pubDate>Sat, 19 Jun 2010 02:03:32 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[About LPI]]></category>

		<guid isPermaLink="false">http://lpilinux.com/?p=576</guid>
		<description><![CDATA[&#8216;System administration command. This simple backup utility accesses ext2 and ext3 file devices directly, quickly backing up files without affecting file access times. files may be specified as a mount point or as a list of files and directories to back up. While you can use this on a mounted system, dump may write corrupted [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fwhat-is-dump-command.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fwhat-is-dump-command.html" height="61" width="51" /></a></div><p>&#8216;System administration command. This simple backup utility accesses ext2 and ext3 file devices directly, quickly backing up files without affecting file access times. files may be specified as a mount point or as a list of files and directories to back up. While you can use this on a mounted system, dump may write corrupted information to the backup when the kernel has written only part of its cached information. Dump maintains a record of which files it has saved in /etc/dumpdates, and will perform incremental backups after creating an initial full backup. Use the restore command to restore a dump backup.<br />
Options<br />
-a</p>
<p>    Write until end-of-media. Default behavior when writing to tape drives.</p>
<p>-A file</p>
<p>    Create a table of contents for the archive in the specified file.</p>
<p>-bblocksize</p>
<p>    Block size in kilobytes to use in dumped records. By default, it is 10, or 32 when dumping to a tape with a density greater than 6250BPI.</p>
<p>-Bblocks</p>
<p>    Specify number of blocks to write per volume.</p>
<p>-c</p>
<p>    Treat target as a 1700-foot-long cartridge tape drive with 8000 bpi. Override end-of-media detection.</p>
<p>-d density</p>
<p>    Specify tape density.</p>
<p>-D file</p>
<p>    Write dump information to file instead of /etc/dumpdates.</p>
<p>-E file</p>
<p>    Exclude inodes specified in file.</p>
<p>-f files</p>
<p>    Write backup volumes to the specified files or devices. Use &#8211; to write to standard output. Separate multiple files with a comma. Use host:file or user@host:file to write to a networked host using either the rmt program or the program specified by the RMT environment variable.</p>
<p>-F script</p>
<p>    Run script at the end of each volume other than the last. dump will pass the current device and volume number to the script. The script should return 0 to continue, 1 to prompt for a new tape, or any other exit value to abort the dump. The script will run with the processes real user and group ID.</p>
<p>-i inodes</p>
<p>    Specify a comma-separated list of inodes to skip.</p>
<p>-I n</p>
<p>    Ignore the first n read errors. dump ignores 32 read errors by default. Specify 0 to ignore all errors. You may need to do this when dumping a mounted filesystem.</p>
<p>-j[level]</p>
<p>    Compress each block using the bzlib library at the specified compression level. By default dump uses level 2 compression.</p>
<p>-k</p>
<p>    Use Kerberos authentication when writing to a remote system.</p>
<p>-L label</p>
<p>    Write the specified volume label into the dump header.</p>
<p>-m</p>
<p>    Save only metadata when backing up changed but not modified files.</p>
<p>-M</p>
<p>    Create a multivolume backup. Treat any filename provided with -f as a prefix.</p>
<p>-n</p>
<p>    Use wall to notify members of group operator when prompting for information.</p>
<p>-q</p>
<p>    Abort the backup instead of prompting for information when operator input is required.</p>
<p>-Q file</p>
<p>    Create Quick Access information in the specified file for use by restore.</p>
<p>-s n</p>
<p>    Write only n feet of tape in a single volume. Prompt for a new tape upon reaching this limit.</p>
<p>-S</p>
<p>    Calculate and print the amount of space required to perform the backup, then exit.</p>
<p>-T date&#8217;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fwhat-is-dump-command.html&amp;linkname=What%20is%20dump%20command%3F" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/what-is-dump-command.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vector Linux 5.9 Standard &#8211; Full Review</title>
		<link>http://lpilinux.com/vector-linux-5-9-standard-full-review.html</link>
		<comments>http://lpilinux.com/vector-linux-5-9-standard-full-review.html#comments</comments>
		<pubDate>Fri, 18 Jun 2010 02:02:04 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[About LPI]]></category>

		<guid isPermaLink="false">http://lpilinux.com/?p=575</guid>
		<description><![CDATA[&#8216;Last year Vector Linux came in four flavors. The list has now been expanded to seven different variations on the distribution: Standard, Deluxe, SOHO, Live, Light, Mini, and Light Live. SOHO, with KDE as the default desktop and all the most popular applications, is the full featured version. Standard is based on the Xfce4 desktop [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fvector-linux-5-9-standard-full-review.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fvector-linux-5-9-standard-full-review.html" height="61" width="51" /></a></div><p>&#8216;Last year Vector Linux came in four flavors. The list has now been expanded to seven different variations on the distribution: Standard, Deluxe, SOHO, Live, Light, Mini, and Light Live. SOHO, with KDE as the default desktop and all the most popular applications, is the full featured version. Standard is based on the Xfce4 desktop and provides superior speed and performance. Both are freely downloadable. Deluxe, available for purchase, is Standard plus a second CD with additional applications including KDE and OpenOffice. Live, as the name implies, is a live CD version of Standard. Light is a paired down, extremely lightweight version designed to run on older systems with as little as 64MB of RAM. In reality it will run with less than that. Light is built around either a JWM or Fluxbox desktop and lightweight applications. Mini is a further reduced version of Light that fits on a 5cm/3″ mini CD and requires only 1.1GB of disk space. Finally, Light Live is, as you’d expect, the live CD version of Light. So far only new Standard and Deluxe versions have been released but the others, all in various stages of development and testing, can already be sampled. This review will stick strictly with the Standard version from here on out.</p>
<p>My main box for testing Vector Linux 5.9 Standard my aging general purpose laptop, a five year old Toshiba Satellite 1805-S204 (1 GHz Celeron processor, 512MB RAM). Though this system has adequate memory for any current Linux distro it’s sufficiently challenged in terms of processing power for KDE to be sluggish and for Gnome to be noticeably slower than Xfce4 in most distros.</p>
<p>Vector Linux is almost to the point where it can seriously considered by almost any user, not just someone experienced with Linux, as most things do work as they should out of the virtual box. Some issues still require manually editing configuration files. I had hoped that by this point VL would be as user friendly as any distro out there but it isn’t there yet.</p>
<p>Installation and Configuration</p>
<p>Vector Linux 5.9 Standard is available for download as a single iso image. I’ve used both supported installation methods: a conventional installation booted from CD-ROM and a hosted installation booted from another Linux distribution already running on the system. There are two scripts provided for hosted installs: one which runs from an iso image on a mounted filesystem and one which runs from a CD-ROM that isn’t bootable. Directions and all the tools needed for a hosted installation from DOS or Windows are also provided. Installation across a network and automated installations, such as Red Hat’s kickstart, are not supported.</p>
<p>Vector Linux still uses an old fashioned text-based installer similar to Slackware, which is fine as far as I am concerned. A new, snazzy graphical installer is still promised for Vector Linux 6. I didn’t test to see if the installer now checks for adequate disk space, a problem with the VL 5.8 Standard installer. You need at least 3.2GB for a reasonably complete installation.</p>
<p>Disk partitioning is handled smoothly in VL 5.9. ext3, reiserfs, jfs, xfs, and trusty old ext2 are all supported. A list of common mount points is provided but the ability to define a non-standard mount point for a partition is lacking. Much like Slackware, Vector Linux still uses lilo and only lilo for the bootloader. Grub is available in the repository and can be installed after installation.</p>
<p>Video hardware detection remains relatively poor compared to other distributions and has not improved since 5.8. For example when I booted up to the GUI I was once again left with a small display in the middle of my screen surrounded by lots of black space. No amount of fiddling with X configuration in vasm (the GUI configuration tool) can make it work the way it should. It turns out the Monitor section of the /etc/X11/xorg.conf file doesn’t have proper horizontal and vertical refresh rates set and you are warned about this possibility by the installer. In addition, some options required by my laptop screen aren’t set. This problem has shown up for other users of Toshiba laptops with similar chipsets as well. Most major distributions simply don’t have problems like this in 2008.</p>
<p>In addition the installer doesn’t setup the system to load the kernel module needed to fully support my laptop at boot. I had to manually add:</p>
<p>modprobe toshiba</p>
<p>to my /etc/rc.d/rc.modules file to correct this. On a plain vanilla desktop system this wouldn’t be an issue, of course, but I suspect other laptop users, not just those of us with Toshiba machines, will need to do some tweaking by hand to get their laptops to be 100% functional under Vector Linux.</p>
<p>Printing and wireless networking aren’t handled by the installer and have to be configured after the system boots up for the first time. Expect to go into vasm or vasmCC to choose what services to start at boot as well.</p>
<p>One unique option in the Vector Linux installer is the ability to chose between HAL and VL-Hot for managing removable media. HAL, used by most distributions, continually polls the hardware and can have a performance impact on slower machines. VL-Hot is triggered by udev events and offers faster performance. It also uses rather long mount point paths which can be annoying if you work at the command line a lot. VL-Hot uses a second desktop icon for unmounting removable media which might be confusing to some. This is typical of many of the innovations found in Vector Linux: power users will love the flexibility and newcomers will wonder what it all means. I think most newcomers to Linux will find HAL easier to deal with.</p>
<p>Seamonkey is the default browser in Vector Linux. Alternate browsers (Firefox, Opera, and Dillo) are offered as options during installation. OpenOffice is not included in the iso but it is available from the repository after installation. AbiWord and Gnumeric are installed by default and Scribus, a desktop publisher, is an installer option. GIMP is also no longer included on the iso but rather is part of the new Multimedia Bonus Disc.</p>
<p>The installer and the documentation are in English, period. No other languages are supported despite huge progress in other areas of internationalization and localization.</p>
<p>Changes Since Vector Linux 5.8</p>
<p>There have been a huge number of changes in the latest release, both in applications and in configuration tools. Xfce 4.4.2 is the default desktop but VL has returned to the practice of offering alternative, lightweight desktops during the initial installation. This was dropped in 5.8. The alternate choices are JWM 2.0.1 and Fluxbox 1.0.0. KDE 3.5.9 is available in the repository as are a nice selection of lightweight window managers. If you choose Xfce you’ll find a much larger selection of panel applets available compared to 5.8. It’s still not the full selection from Xfce Goodies but I suspect most users will find what they want. Thunar is now the only fine manager installed by default but a number of others, including Xfe and pcmanfm, are available in the repository.</p>
<p>The biggest steps forward are the tools to manage and configure the system. vasm, the graphical system configuration tool, still isn’t the prettiest out there but it has a lot of functionality and works flawlessly. It’s now joined by vasmCC. The new Control Center is a fully graphical, pretty, and very functional tool for system configuration with most but not quite all the functionality of vasm. It’s reasonably easy to use and generally quite intuitive. OK, it would be more obvious for newcomers if an icon in the Network section was labeled “Network Configuration” instead of “Netconf”, but that’s a minor quibble. Once you get to below the second level of icons things look suspiciously like vasm but that’s to be expected and everything still works flawlessly.</p>
<p>WiFi-Radar now allows changing configuration settings within the GUI with a new preferences tab. You no longer a need to manually edit a configuration file to setup a wireless network interface. In addition, the semi-graphical alternative, vwifi, also works flawlessly. gslapt, the graphical package manager, now correctly displays dependencies for most packages. All in all configuring Vector Linux is now easier than in any previous release in most cases.</p>
<p>Under the hood Vector Linux now runs on a 2.6.22.14 kernel. An updated 2.6.24.3 kernel is currently in testing. It’s worked flawlessly for me so far but I did have to compile an updated madwifi driver to work with it. That should be included in the final package. Users who stick with the default kernel are well advised to install the novmsplice module to close a significant security vulnerability which came to light after VL 5.9 was released.</p>
<p>Kernel level support for popular laptops works as expected. Tools for my laptop, such as toshset, are in the repository.</p>
<p>Multimedia applications including XMMS, Xine, and optionally MPlayer have all been updated. Canada, the home of Vector Linux, has no equivalent to the DMCA so all the libraries and Win32 codecs are installed by default. Vector Linux is ready to play your mp3 files and DVDs right out of the (virtual) box. People in the United States will need to remove some packages after installation in order to comply with the law.</p>
<p>k3b, the KDE tool for burning CDs and DVDs, is the nicest of its kind for any platform and is now available as an option during install. KDE does not have to be installed to use k3b in VL, but a number of required KDE libraries are automatically included if you choose this option. The alternative is xfburn, a rather simplistic and limited CD burner designed to integrate with Xfce. Graveman, which I found to be horribly buggy, is no longer included.</p>
<p>The number of games included in the iso image have been greatly reduced. The repository does contain a large selection of games that more than makes up for this.</p>
<p>One of the most interesting new tools included in Vector Linux 5.9 is vpackager, a remarkably easy to use graphical tool to build packages from source. I suspect a lot of relatively new Linux users who looked at compiling software from source code as a daunting task will be surprised at just how easy it can be with vpackager. vpackager is also designed to work with CruxPorts4Slax but unfortunately that functionality isn’t quite ready from prime time just yet. When everything works properly there will be a truly easy way to install software directly from source. A How-To for wriiting ports for CruxPorts4Slack is included in the Vector Linux Wiki.</p>
<p>Running Vector Linux 5.9 Standard</p>
<p>Unlike Ubuntu (or Xubuntu or Kubuntu) the VL installer doesn’t leave you with a stripped down system to build on. It takes the approach used by larger distributions (i.e.: Fedora, Suse, Mandriva) and gives you a system with a fairly comprehensive set of applications immediately available after installation and configuration.</p>
<p>One of the main reasons I keep coming back to Vector Linux after trying other distributions is because it clearly is the fastest distribution with a decent set of applications and features for my older hardware Once you get past installation and configuration I still give Vector Linux a slight edge over most other distributions in terms of a user friendly, well thought out desktop.</p>
<p>I did run into a few bugs. As I previously reported Vetcor Linux 5.9 installs a full set of fonts for X by default but only enables the TrueType and OpenType fonts. Installing a package called fontfix, currently in the testing repository, resolved this problem.</p>
<p>Another annoying but minor issue is a display problem in AbiWord. Vector Linux developers chose to go with the latest bleeding edge development version, 2.5.2, rather than the latest stable release. 2.5.2 generally works but I often get a floating part of the toolbar about halfway down my screen. It’s always on top and doesn’t go away when I change instances of AbiWord or even switch to another application window. It only disappears when I close the instance of AbiWord that caused the problem. I’ve also had some interesting (OK, weird) fonts and spacing magically appear in documents.</p>
<p>The included version of Opera is also bleeding edge, a preview release of 9.50. It mostly works well but I’ve run into some issues with Javascript and a few web forms.</p>
<p>The Vector Linux 5.9 repositories include far more packages than ever before. Unfortunately there is currently a large backlog of packages in the testing repository that haven’t made it to extra just yet. Users may need to enable the testing repository to find applications they want and then disable it again before doing a system upgrade. While the number of packaged applications for Vector Linux continues to grow rapidly it still falls far short of what is available for distributions like Debian, Mandriva, Ubuntu, or Fedora. VL 5.9 is based on Slackware 12 and any Slackware packages, including those from third party sources like linuxpackages.net or slacky.eu, should work on Vector with one caveat: dependency checking may not work correctly. It’s pretty easy to end up in dependency hell if you enable third party repositories.</p>
<p>Multimedia and graphics software, as well as software of interest to musicians, are not going to be an issue. The selection for Vector Linux is now truly up to par thanks to the new Multimedia Bonus Disc, which deserves a review of its own.</p>
<p>Security Concerns and Package Management</p>
<p>In my review of Vector Linux 5.8 Standard I devoted a lot of space to package management, specifically the fact that for the first time in a distribution derivative of Slackware packages could be handled much the same way as they can in Debian based distributions using slapt-get and gslapt. gslapt is very similar in look and feel to synaptic and works in much the same way. slapt-get is similar to apt-get though the command syntax is different. Other distributions, i.e.: Wolvix 1.1.0, have followed suit.</p>
<p>The good news is that throughout the lifecycle of Vector Linux 5.8 and now 5.9 doing a:</p>
<p>slapt-get &#8211;update<br />
slapt-get &#8211;upgrade</p>
<p>does precisely what you’d expect it to: cleanly upgrade your system by finding all the latest patches and updates and installing them. The bad news is that in Vector Linux 5.9 this functionality has been disabled from gslapt, the graphical alternative. Writing in the Vector Linux forum, one user who calls herself GrannyGeek put it this way:</p>
<p>    ﻿I’m not glad at all that the Mark All Upgrades and View Marked have been disabled. This is nannyism at its worst. I *like* to be able to see what upgrades are available in a way that’s less laborious than going through the whole lengthy list of packages. Marking upgrades and viewing what’s marked was a convenient way to do this.</p>
<p>Disabling that feature was a really bad idea because it makes keeping a system secure difficult for a Linux newcomer. There is now no automated method within the GUI to determine what patches are out there and install them.</p>
<p>It’s worse than that. While the Vector Linux developers have been lightning fast at getting new packages out to close security vulnerabilities since the release of 5.9, there is no set method to inform users that a patch is available or even necessary. A security section exists within the forum but it isn’t used. This wasn’t a big issue in VL 5.8 because one quick check of gslapt would show you what’s out there. That simply isn’t true any longer for users who aren’t knowledgeable and comfortable on the command line.</p>
<p>Internationalization and Localization</p>
<p>Support for languages other than English has always been an area where Vector Linux was weak compared to other distributions. There has been tremendous improvement in VL 5.9 in terms of providing the tools necessary for supporting a large variety of languages. What is still lacking are graphical configuration tools to allow a newcomer to change language, locale, and keyboard settings for the system default, individual users, or on a session by session bases.</p>
<p>A wide variety of international font sets for languages that use non-Latin character sets are now installed by default. One one hand I’m not sure how many Vector Linux users are likely to need the Syriac or Ethiopic fonts which are installed. On the other hand Vector Linux is probably the only distro where probably every web page in the world will likely be displayed correctly out of the box. Whether a user can read what’s displayed is another matter. I should note that the full set of Cyrillic fonts for X is installed by default but not enabled. The fontfix package I referred to earlier does remedy this. In addition the selection of fonts for a given set of non-Latin glyphs is generally small. Additional font packages are beginning to show up in the repository.</p>
<p>KDE i18n packages are in the main repository. fribidi, the software at the core of support for languages written right to left such as Arabic, Hebrew, and Thai, is installed by default. The Xfce4 keyboard switching applet is also included. That applet doesn’t alter the /etc/X11/xorg.conf file, though, so if you don’t have KDE installed you still have to manually edit that file to add support for additional keyboard layouts other than your chosen default.</p>
<p>A full set of aspell dictionaries are now in the repository as are language packs for Mozilla Firefox, Thunderbird, and Sunbird. This is a huge step forward. Strangely langauge packs for Seamonkey, the default browser in VL, aren’t there yet. Open Office internationalization packages and dictionaries are also still missing.</p>
<p>If your goal is a truly localized system, not just a system running in English with support for other languages, you still need to do significant work to make it happen in Vector Linux Standard. Most all packages are now built with whatever translations are available. However, the default display manager is a rebuilt, trimmed down version of kdm. As previously noted language switching at login is not supported. If you want to change the default language or locale you have to do it at the command line and/or by editing appropriate configuration files.</p>
<p>Conclusions</p>
<p>Many of the issues I complained about in my previous review of Vector Linux 5.8 were fixed in 5.9. The installer still has some issues with hardware detection on my laptop. I had to do only minor configuration tweaking after installation and I was up and running. Someone with well supported desktop hardware might find the Vector Linux “just works” for them. Internationalization and localization are vastly improved in VL 5.9 but there still is a long way to go to make it user friendly and some packages are still lacking.</p>
<p>Once you have Vector Linux installed, configured, and customized to your needs it’s an absolute pleasure to run. It’s fast and sleek and well thought out. Experienced Linux users and those willing to roll up their sleeves and learn will likely find Vector Linux to be one of the best desktop distributions out there. Newcomers and anyone else who just wants things to work after a simple installation may still find that getting Vector Linux 5.9 is still an exercise in frustration if there is anything that isn’t vanilla in their system. Those whose primary language is something other than English and aren’t bothered by the lack of GUI tools may find that Vector Linux 5.9 finally meets there needs. Newcomers to Linux and anyone uncomfortable with manually editing configuration files will find that getting VL to work for them in their own language is more than they bargained for.</p>
<p>Vector Linux 5.9 is their best release yet. It just isn’t for everyone. Vector Linux was about 90% of the way to being about the best distro out there a year ago. While tremendous progress has been made in some areas in other areas, like keeping a system upgraded and secure, VL actually took a step backwards with this release. With a little more attention to the needs of newcomers Vector Linux could become the next big Linux distribution.</p>
<p>I have yet to find a perfect Linux distribution and I have never written a review where I didn’t find something to complain about. Even with the issues I’ve raised Vector Linux is still my favorite distribution for the desktop or laptop.&#8217;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fvector-linux-5-9-standard-full-review.html&amp;linkname=Vector%20Linux%205.9%20Standard%20%26%238211%3B%20Full%20Review" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/vector-linux-5-9-standard-full-review.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi tail in Linux</title>
		<link>http://lpilinux.com/multi-tail-in-linux.html</link>
		<comments>http://lpilinux.com/multi-tail-in-linux.html#comments</comments>
		<pubDate>Thu, 17 Jun 2010 01:56:05 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[About LPI]]></category>

		<guid isPermaLink="false">http://lpilinux.com/?p=574</guid>
		<description><![CDATA[&#8216;A few weeks ago a new version of RSSTail came out. After reading the RSSTail page I found out that you can use RSSTail as a plugin to a fantastic application called multitaill. That is when I realized that multitail is actually written by the same person.
If you rely on tail, or have ever used [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fmulti-tail-in-linux.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fmulti-tail-in-linux.html" height="61" width="51" /></a></div><p>&#8216;A few weeks ago a new version of RSSTail came out. After reading the RSSTail page I found out that you can use RSSTail as a plugin to a fantastic application called multitaill. That is when I realized that multitail is actually written by the same person.</p>
<p>If you rely on tail, or have ever used tail you’ll probably enjoy this one. As the name implies it is a pager like tail except that it supports for more than one stream. Now, I know some of you have probably used some wizardry do get your favorite pager to show multiple streams, either in the same output or by using screen / splitvt but multitail really simplifies the process. It has all kinds of settings (such as color) and allows you to manage your tail’d files on the fly and even save the current view for later use. It does have a little bit of a learning curve but I think it is well worth it, especially if one of your hobbies includes log watching.&#8217;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fmulti-tail-in-linux.html&amp;linkname=Multi%20tail%20in%20Linux" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/multi-tail-in-linux.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple updates Mac malware protection</title>
		<link>http://lpilinux.com/apple-updates-mac-malware-protection.html</link>
		<comments>http://lpilinux.com/apple-updates-mac-malware-protection.html#comments</comments>
		<pubDate>Wed, 16 Jun 2010 01:54:05 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://lpilinux.com/?p=573</guid>
		<description><![CDATA[&#8216;Researchers at Sophos discovered that Apple updated the anti-malware protection built-into Mac OS X when it released a new version earlier this week.
Mac OS X 10.6.4 has been updated to provide limited protection against OSX/Pinhead-B (called HellRTS by Apple), a backdoor Trojan which can allow remote hackers to gain control over Mac computers for the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fapple-updates-mac-malware-protection.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fapple-updates-mac-malware-protection.html" height="61" width="51" /></a></div><p>&#8216;Researchers at Sophos discovered that Apple updated the anti-malware protection built-into Mac OS X when it released a new version earlier this week.</p>
<p>Mac OS X 10.6.4 has been updated to provide limited protection against OSX/Pinhead-B (called HellRTS by Apple), a backdoor Trojan which can allow remote hackers to gain control over Mac computers for the purposes of identity theft, spying and the distribution of spam.</p>
<p>This malware was distributed disguised as the iPhoto application by malicious hackers.</p>
<p>Sophos researchers discovered that Apple updated a file called XProtect.plist &#8211; the file that contains elementary signatures of a handful of Mac threats &#8211; to detect HellRTS.</p>
<p>&#8216;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fapple-updates-mac-malware-protection.html&amp;linkname=Apple%20updates%20Mac%20malware%20protection" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/apple-updates-mac-malware-protection.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use HTML files to redirect users to malicious sites, evade mail server antivirus</title>
		<link>http://lpilinux.com/how-to-use-html-files-to-redirect-users-to-malicious-sites-evade-mail-server-antivirus.html</link>
		<comments>http://lpilinux.com/how-to-use-html-files-to-redirect-users-to-malicious-sites-evade-mail-server-antivirus.html#comments</comments>
		<pubDate>Tue, 15 Jun 2010 01:52:45 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://lpilinux.com/?p=572</guid>
		<description><![CDATA[&#8216;Facebook, Twitter and Skype are Internet behemoths, counting hundreds of millions users each, so it is not surprising that many malicious email campaigns masquerade as legitimate notices coming from these three sources.
The number of emails that try to trick recipients into downloading malicious files has surged in the last few days. Users are notified that [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-use-html-files-to-redirect-users-to-malicious-sites-evade-mail-server-antivirus.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-use-html-files-to-redirect-users-to-malicious-sites-evade-mail-server-antivirus.html" height="61" width="51" /></a></div><p>&#8216;Facebook, Twitter and Skype are Internet behemoths, counting hundreds of millions users each, so it is not surprising that many malicious email campaigns masquerade as legitimate notices coming from these three sources.</p>
<p>The number of emails that try to trick recipients into downloading malicious files has surged in the last few days. Users are notified that their Twitter or Facebook password has been reset, that they should check details of purchases effected through Skype, that they have messages waiting for them, etc.</p>
<p>What these emails have in common is that they contain a .html file, which changes name from email to email, but always contains a a script that redirects the users to a website rife with malicious code that tries to exploit vulnerabilities in Adobe, IE and Java and through them download malware on the users&#8217; computer.</p>
<p>A Bkis security researcher thinks we are witnessing the birth of a new trend. According to him, attackers will be switching to this kind malicious files for two reasons:</p>
<p>    * A lot of people have learned by now that .exe and .zip files in attachments are probably bad news and they delete the email, but .html files have managed to avoid looking instantly suspicious.<br />
    * These .html attachments don&#8217;t contain any kind of malicious or exploit code, which makes them perfect for bypassing antivirus programs integrated in mail servers or antivirus solutions in general:</p>
<p>      When you think about it, the file in question does the exact same thing a malicious link would do, but &#8211; once again &#8211; many users have learned not to click on those either.<br />
&#8216;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fhow-to-use-html-files-to-redirect-users-to-malicious-sites-evade-mail-server-antivirus.html&amp;linkname=How%20to%20use%20HTML%20files%20to%20redirect%20users%20to%20malicious%20sites%2C%20evade%20mail%20server%20antivirus" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-use-html-files-to-redirect-users-to-malicious-sites-evade-mail-server-antivirus.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>100 Potential attacks per second blocked in 2009</title>
		<link>http://lpilinux.com/100-potential-attacks-per-second-blocked-in-2009.html</link>
		<comments>http://lpilinux.com/100-potential-attacks-per-second-blocked-in-2009.html#comments</comments>
		<pubDate>Mon, 14 Jun 2010 01:51:17 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://lpilinux.com/?p=571</guid>
		<description><![CDATA[&#8216;Symantec released its new security threat report which highlights key trends in cybercrime from Jan.1, 2009 to Dec. 31, 2009. In a year bookended by two very prominent cyber attacks – Conficker in the opening months of the year and Hydraq at the very end – the report reveals continued growth in both the volume [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2F100-potential-attacks-per-second-blocked-in-2009.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2F100-potential-attacks-per-second-blocked-in-2009.html" height="61" width="51" /></a></div><p>&#8216;Symantec released its new security threat report which highlights key trends in cybercrime from Jan.1, 2009 to Dec. 31, 2009. In a year bookended by two very prominent cyber attacks – Conficker in the opening months of the year and Hydraq at the very end – the report reveals continued growth in both the volume and sophistication of cybercrime attacks.</p>
<p>Notable trends highlighted in this year’s report include:</p>
<p>An increase in the number of targeted threats focused on enterprises<br />
Given the potential for monetary gain from compromised corporate intellectual property (IP), cybercriminals have turned their attention toward enterprises. The report found that attackers are leveraging the abundance of personal information openly available on social networking sites to synthesize socially engineered attacks on key individuals within targeted companies. Hydraq gained a great deal of notoriety at the beginning of 2010, but was only the latest in a long line of such targeted attacks including Shadow Network in 2009 and Ghostnet in 2008.</p>
<p>Attack toolkits make cybercrime easier than ever<br />
Cybercrime attack toolkits have lowered the bar to entry for new cybercriminals, making it easy for unskilled attackers to compromise computers and steal information. One such toolkit called Zeus (Zbot), which can be purchased for as little as $700, automates the process of creating customized malware capable of stealing personal information. Using kits like Zeus, attackers created literally millions of new malicious code variants in an effort to evade detection by security software.</p>
<p>Web-based attacks continued to grow unabated<br />
Today’s attackers leverage social engineering techniques to lure unsuspecting users to malicious websites. These websites then attack the victim’s Web browser and vulnerable plug-ins normally used to view video or document files. In particular, 2009 saw dramatic growth in the number of Web-based attacks targeted at PDF viewers; this accounted for 49 percent of observed Web-based attacks. This is a sizeable increase from the 11 percent reported in 2008.</p>
<p>Malicious activity takes root in emerging countries<br />
The report saw firm signs that malicious activity is now taking root in countries with an emerging broadband infrastructure, such as Brazil, India, Poland, Vietnam and Russia. In 2009, these countries moved up the rankings as a source and target of malicious activity by cybercriminals. The findings from the report suggest that government crackdowns in developed countries have led cybercriminals to launch their attacks from the developing world, where they are less likely to be prosecuted.</p>
<p>Other ISTR highlights:</p>
<p>    * Malicious code is more rampant than ever. In 2009, Symantec identified more than 240 million distinct new malicious programs, a 100 percent increase over 2008.<br />
    * Top threats. The Sality.AE virus, the Brisv Trojan and the SillyFDC worm were the threats most frequently blocked by Symantec security software in 2009.<br />
    * Downadup (Conficker) still very prevalent. It was estimated that Downadup was on more than 6.5 million PCs worldwide at the end of 2009. Thus far, machines still infected with Downadup/Conficker have not been utilized for any significant criminal activity, but the threat remains a viable one.<br />
    * Compromised identity information continues to grow. Sixty percent of all data breaches that exposed identities were the result of hacking. In a sign that this issue is not limited to a few larger enterprises, the Symantec State of Enterprise Security Report 2010 reported that 75 percent of enterprises surveyed experienced some form of cyber attack in 2009.<br />
    * Another turbulent year for spam. In 2009, spam made up 88 percent of all e-mail observed by Symantec, with a high of 90.4 percent in May and a low of 73.7 percent in February. Of the 107 billion spam messages distributed globally per day on average, 85 percent were from botnets. The 10 major bot networks, including Cutwail, Rustock and Mega-D now control at least 5 million compromised computers. Throughout 2009, Symantec saw botnet infected computers being advertised in the underground economy for as little as 3 cents per computer.<br />
    * Applying security patches continues to be a challenge for many users. The report found that maintaining a secure, patched system became more challenging than ever in 2009. Moreover, many users are failing to patch even very old vulnerabilities. For example, the Microsoft Internet Explorer ADODB.Stream Object File Installation Weakness was published on August 23, 2003, and fixes have been available since July 2, 2004, yet it was the second-most attacked Web-based vulnerability in 2009.</p>
<p>“Attackers have evolved from simple scams to highly sophisticated espionage campaigns targeting some of the world’s largest corporations and government entities,” said Stephen Trilling, senior VP, Security Technology and Response, Symantec. “The scale of these attacks and the fact that they originate from across the world, makes this a truly international problem requiring the cooperation of both the private sector and world governments.”</p>
<p>The complete report is available here. &#8216;<a href="http://www.net-security.org/secworld.php?id=9164">net-security.org</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2F100-potential-attacks-per-second-blocked-in-2009.html&amp;linkname=100%20Potential%20attacks%20per%20second%20blocked%20in%202009" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/100-potential-attacks-per-second-blocked-in-2009.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qubes &#8211; A Highly Secure OS Powered By Xen Hypervisor</title>
		<link>http://lpilinux.com/qubes-a-highly-secure-os-powered-by-xen-hypervisor.html</link>
		<comments>http://lpilinux.com/qubes-a-highly-secure-os-powered-by-xen-hypervisor.html#comments</comments>
		<pubDate>Sat, 05 Jun 2010 04:36:00 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://lpilinux.com/?p=569</guid>
		<description><![CDATA[&#8216;Qubes is an open source operating system based on Linux, which is designed to provide strong security for desktop computing. Its unique selling point is that all applications that are run on Qubes is sand-boxed from each other.
This is achieved by way of virtualization of all applications using Xen Hypervisor.
Computer systems usually provide OS security [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fqubes-a-highly-secure-os-powered-by-xen-hypervisor.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fqubes-a-highly-secure-os-powered-by-xen-hypervisor.html" height="61" width="51" /></a></div><p>&#8216;Qubes is an open source operating system based on Linux, which is designed to provide strong security for desktop computing. Its unique selling point is that all applications that are run on Qubes is sand-boxed from each other.</p>
<p>This is achieved by way of virtualization of all applications using Xen Hypervisor.</p>
<p>Computer systems usually provide OS security in three basic ways, namely -</p>
<p>   1. Security by correctness,<br />
   2. Security by obscurity, and<br />
   3. Security by isolation.</p>
<p>Qubes OS developers have embraced the path of security by isolation. To do this Qubes utilizes virtualization technology to isolate various programs from each other. This makes Qubes OS a secure by default operating system.</p>
<p>The idea is that virtual machines will be created on demand, for each application and discarded after use. Industry pundits have coined a new name for it &#8211; Disposable Virtual Machine technology.&#8217;<a href="http://linuxhelp.blogspot.com/2010/06/qubes-highly-secure-os-powered-by-xen.html">linuxhelp.blogspot.com</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fqubes-a-highly-secure-os-powered-by-xen-hypervisor.html&amp;linkname=Qubes%20%26%238211%3B%20A%20Highly%20Secure%20OS%20Powered%20By%20Xen%20Hypervisor" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/qubes-a-highly-secure-os-powered-by-xen-hypervisor.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foreach Statement in PHP &#8211; Full Tutorial</title>
		<link>http://lpilinux.com/foreach-statement-in-php-full-tutorial.html</link>
		<comments>http://lpilinux.com/foreach-statement-in-php-full-tutorial.html#comments</comments>
		<pubDate>Wed, 26 May 2010 03:01:22 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://lpilinux.com/foreach-statement-in-php-full-tutorial.html</guid>
		<description><![CDATA[PHP 4 introduced a foreach construct, much like Perl and some other languages. This simply gives an easy way to iterate over arrays. foreach works only on arrays, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes; [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fforeach-statement-in-php-full-tutorial.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fforeach-statement-in-php-full-tutorial.html" height="61" width="51" /></a></div><p>PHP 4 introduced a foreach construct, much like Perl and some other languages. This simply gives an easy way to iterate over arrays. foreach works only on arrays, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes; the second is a minor but useful extension of the first:</p>
<p>foreach (array_expression as $value)<br />
    statement<br />
foreach (array_expression as $key => $value)<br />
    statement</p>
<p>The first form loops over the array given by array_expression. On each loop, the value of the current element is assigned to $value and the internal array pointer is advanced by one (so on the next loop, you&#8217;ll be looking at the next element).</p>
<p>The second form does the same thing, except that the current element&#8217;s key will be assigned to the variable $key on each loop.</p>
<p>As of PHP 5, it is possible to iterate objects too.</p>
<p>    Note: When foreach first starts executing, the internal array pointer is automatically reset to the first element of the array. This means that you do not need to call reset() before a foreach loop.</p>
<p>    Note: Unless the array is referenced, foreach operates on a copy of the specified array and not the array itself. foreach has some side effects on the array pointer. Don&#8217;t rely on the array pointer during or after the foreach without resetting it.</p>
<p>As of PHP 5, you can easily modify array&#8217;s elements by preceding $value with &#038;. This will assign reference instead of copying the value.<br />
< ?php<br />
$arr = array(1, 2, 3, 4);<br />
foreach ($arr as &#038;$value) {<br />
    $value = $value * 2;<br />
}<br />
// $arr is now array(2, 4, 6, <img src='http://lpilinux.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> unset($value); // break the reference with the last element<br />
?><br />
This is possible only if iterated array can be referenced (i.e. is variable), that means the following code won&#8217;t work:<br />
< ?php<br />
foreach (array(1, 2, 3, 4) as &#038;$value) {<br />
    $value = $value * 2;<br />
}</p>
<p>?><br />
Warning</p>
<p>Reference of a $value and the last array element remain even after the foreach loop. It is recommended to destroy it by unset().</p>
<p>    Note: foreach does not support the ability to suppress error messages using &#8216;@&#8217;.</p>
<p>You may have noticed that the following are functionally identical:<br />
< ?php<br />
$arr = array("one", "two", "three");<br />
reset($arr);<br />
while (list(, $value) = each($arr)) {<br />
    echo "Value: $value<br />\n&#8221;;<br />
}</p>
<p>foreach ($arr as $value) {<br />
    echo &#8220;Value: $value<br />\n&#8221;;<br />
}<br />
?><br />
The following are also functionally identical:<br />
< ?php<br />
$arr = array("one", "two", "three");<br />
reset($arr);<br />
while (list($key, $value) = each($arr)) {<br />
    echo "Key: $key; Value: $value<br />\n&#8221;;<br />
}</p>
<p>foreach ($arr as $key => $value) {<br />
    echo &#8220;Key: $key; Value: $value<br />\n&#8221;;<br />
}<br />
?></p>
<p>Some more examples to demonstrate usages:<br />
< ?php<br />
/* foreach example 1: value only */</p>
<p>$a = array(1, 2, 3, 17);</p>
<p>foreach ($a as $v) {<br />
    echo "Current value of \$a: $v.\n";<br />
}</p>
<p>/* foreach example 2: value (with its manual access notation printed for illustration) */</p>
<p>$a = array(1, 2, 3, 17);</p>
<p>$i = 0; /* for illustrative purposes only */</p>
<p>foreach ($a as $v) {<br />
    echo "\$a[$i] => $v.\n&#8221;;<br />
    $i++;<br />
}</p>
<p>/* foreach example 3: key and value */</p>
<p>$a = array(<br />
    &#8220;one&#8221; => 1,<br />
    &#8220;two&#8221; => 2,<br />
    &#8220;three&#8221; => 3,<br />
    &#8220;seventeen&#8221; => 17<br />
);</p>
<p>foreach ($a as $k => $v) {<br />
    echo &#8220;\$a[$k] => $v.\n&#8221;;<br />
}</p>
<p>/* foreach example 4: multi-dimensional arrays */<br />
$a = array();<br />
$a[0][0] = &#8220;a&#8221;;<br />
$a[0][1] = &#8220;b&#8221;;<br />
$a[1][0] = &#8220;y&#8221;;<br />
$a[1][1] = &#8220;z&#8221;;</p>
<p>foreach ($a as $v1) {<br />
    foreach ($v1 as $v2) {<br />
        echo &#8220;$v2\n&#8221;;<br />
    }<br />
}</p>
<p>/* foreach example 5: dynamic arrays */</p>
<p>foreach (array(1, 2, 3, 4, 5) as $v) {<br />
    echo &#8220;$v\n&#8221;;<br />
}<br />
?></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fforeach-statement-in-php-full-tutorial.html&amp;linkname=Foreach%20Statement%20in%20PHP%20%26%238211%3B%20Full%20Tutorial" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/foreach-statement-in-php-full-tutorial.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>include_once difference between PHP 4 and PHP 5</title>
		<link>http://lpilinux.com/include_once-difference-between-php-4-and-php-5.html</link>
		<comments>http://lpilinux.com/include_once-difference-between-php-4-and-php-5.html#comments</comments>
		<pubDate>Wed, 26 May 2010 02:59:51 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://lpilinux.com/include_once-difference-between-php-4-and-php-5.html</guid>
		<description><![CDATA[The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again. As the name suggests, it will be included just [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Finclude_once-difference-between-php-4-and-php-5.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Finclude_once-difference-between-php-4-and-php-5.html" height="61" width="51" /></a></div><p>The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again. As the name suggests, it will be included just once.</p>
<p>include_once() may be used in cases where the same file might be included and evaluated more than once during a particular execution of a script, so in this case it may help avoid problems such as function redefinitions, variable value reassignments, etc.</p>
<p>See the include() documentation for information about how this function works.</p>
<p>    Note: With PHP 4, _once functionality differs with case-insensitive operating systems (like Windows) so for example:</p>
<p>    Example #1 include_once() with a case insensitive OS in PHP 4<br />
    < ?php<br />
    include_once "a.php"; // this will include a.php<br />
    include_once "A.php"; // this will include a.php again! (PHP 4 only)<br />
    ?></p>
<p>    This behaviour changed in PHP 5, so for example with Windows the path is normalized first so that C:\PROGRA~1\A.php is realized the same as C:\Program Files\a.php and the file is included just once. </p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Finclude_once-difference-between-php-4-and-php-5.html&amp;linkname=include_once%20difference%20between%20PHP%204%20and%20PHP%205" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/include_once-difference-between-php-4-and-php-5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to uploads Multiple files using PHP</title>
		<link>http://lpilinux.com/how-to-uploads-multiple-files-using-php.html</link>
		<comments>http://lpilinux.com/how-to-uploads-multiple-files-using-php.html#comments</comments>
		<pubDate>Wed, 26 May 2010 02:58:17 +0000</pubDate>
		<dc:creator>lpilinuxblog</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://lpilinux.com/how-to-uploads-multiple-files-using-php.html</guid>
		<description><![CDATA[Multiple files can be uploaded using different name for input.
It is also possible to upload multiple files simultaneously and have the information organized automatically in arrays for you. To do so, you need to use the same array submission syntax in the HTML form as you do with multiple selects and checkboxes:
Example #1 Uploading multiple [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flpilinux.com%2Fhow-to-uploads-multiple-files-using-php.html"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flpilinux.com%2Fhow-to-uploads-multiple-files-using-php.html" height="61" width="51" /></a></div><p>Multiple files can be uploaded using different name for input.</p>
<p>It is also possible to upload multiple files simultaneously and have the information organized automatically in arrays for you. To do so, you need to use the same array submission syntax in the HTML form as you do with multiple selects and checkboxes:</p>
<p>Example #1 Uploading multiple files</p>
<form action="file-upload.php" method="post" enctype="multipart/form-data"><p>
  Send these files:</p>
<input name="userfile[]" type="file" /></p>
<input name="userfile[]" type="file" /></p>
<input type="submit" value="Send files" />
</form>
<p>When the above form is submitted, the arrays $_FILES['userfile'], $_FILES['userfile']['name'], and $_FILES['userfile']['size'] will be initialized (as well as in $HTTP_POST_FILES for PHP versions prior to 4.1.0). When register_globals is on, globals for uploaded files are also initialized. Each of these will be a numerically indexed array of the appropriate values for the submitted files.</p>
<p>For instance, assume that the filenames /home/test/review.html and /home/test/xwp.out are submitted. In this case, $_FILES['userfile']['name'][0] would contain the value review.html, and $_FILES['userfile']['name'][1] would contain the value xwp.out. Similarly, $_FILES['userfile']['size'][0] would contain review.html&#8217;s file size, and so forth.</p>
<p>$_FILES['userfile']['name'][0], $_FILES['userfile']['tmp_name'][0], $_FILES['userfile']['size'][0], and $_FILES['userfile']['type'][0] are also set. </p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Flpilinux.com%2Fhow-to-uploads-multiple-files-using-php.html&amp;linkname=How%20to%20uploads%20Multiple%20files%20using%20PHP" target="_blank"><img src="http://lpilinux.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://lpilinux.com/how-to-uploads-multiple-files-using-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
