<?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>Beginner Linux Tutorial</title>
	<atom:link href="http://beginnerlinuxtutorial.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://beginnerlinuxtutorial.com</link>
	<description>Online Linux tutorial for beginners</description>
	<lastBuildDate>Sat, 26 Jun 2010 05:21:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Fastest Linux Shell</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/speed-tweaks/fastest-linux-shell/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/speed-tweaks/fastest-linux-shell/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 05:21:54 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Speed Tweaks]]></category>
		<category><![CDATA[fast linux shell]]></category>
		<category><![CDATA[fast shell]]></category>
		<category><![CDATA[fastest linux shell]]></category>
		<category><![CDATA[lightweight Linux shell]]></category>
		<category><![CDATA[linux shell]]></category>
		<category><![CDATA[linux speed tweaks]]></category>
		<category><![CDATA[speed up Linux]]></category>
		<category><![CDATA[speed up pc]]></category>
		<category><![CDATA[tweak computer]]></category>
		<category><![CDATA[tweak Linux]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=180</guid>
		<description><![CDATA[There are many of you out there always looking for another way to tweak your Linux computer to make it even faster. Well this is just one of my tips that will help speed up your overall system slightly. Most of you out there are probably using bash as your Linux shell. This is fine, [...]]]></description>
			<content:encoded><![CDATA[<p>There are many of you out there always looking for another way to tweak your Linux computer to make it even faster. Well this is just one of my tips that will help speed up your overall system slightly. Most of you out there are probably using <code>bash</code> as your Linux shell. This is fine, but there are other shells available that are faster, smaller, and use less system resources.<br />
Everytime you login to your Linux system, open a terminal, execute a script, etc. you are opening up another Linux shell. Most of you Linux users are thinking it&#8217;s just a Linux shell, it doesn&#8217;t take up much resources, that&#8217;s true, but just think if you had 10 shells running. The system memory usage would increase a bit. Plus for those of you that don&#8217;t have faster computer hardware with tons of resources, we want to conserve as much RAM as possible.<br />
So what can we do about all these Linux shells running eating up our system resources? We can install a lightweight shell and set it to be your default Linux shell. Let&#8217;s install <code>dash</code> which is a replacement of <code>ash</code> (Almquist Shell) which was a BSD-licensed replacement for the Bourne Shell that was used in low resource systems.<br />
Depending on what Linux distro you are running, you may need to install <code>dash</code> slightly differently. First lets install <code>dash</code>.</p>
<ul>
<li>Gentoo: <code>emerge --sync &#038;&#038; emerge dash</code></li>
<li>Debain: <code>apt-get update &#038;&#038; apt-get install dash</code></li>
<li>Fedora: <code>yum install dash</code></li>
</ul>
<p>Now that you have <code>dash</code> installed, we want to make <code>dash</code> your default Linux shell. To do this first we want to open a terminal. Type <code>su</code>, enter your root password, open your favorite text editor and edit <code>/etc/passwd</code>. Any username you want to use the <code>dash</code> shell, change <code>/bin/bash</code> to <code>/bin/dash</code> and save the file.<br />
Now we want to change the symlink of <code>/bin/sh</code> to point to <code>/bin/dash</code> instead of <code>/bin/bash</code>. To do this we must first delete the current symlink <code>/bin/sh</code>. In your terminal, type <code>rm -f /bin/sh</code> now we need to create a new symlink to <code>/bin/dash</code>. To do this in your terminal type <code>ln -s /bin/dash /bin/sh</code> and now you are done. Logout and log back in and all of your terminals and shells will be using <code>dash</code>.<br />
NOTE: <code>dash</code> is a very lightweight Linux shell and does not have many features that <code>bash</code> and some other Linux shells have. <code>dash</code> does not support tab complete, so you can&#8217;t type <code>cd /us(TAB)sr(TAB)lin(TAB)</code> and be taken to <code>/usr/src/linux</code>. <code>dash</code> does not support history either, so if you were just doing a bunch of long commands in a shell and didn&#8217;t want to retype them, just hit up a couple times and then hit enter, well you can&#8217;t with <code>dash</code>, but you will notice your scripts running faster, terminals opening faster, less ram being used, etc.<br />
I hope this <a href="http://beginnerlinuxtutorial.com/help-tutorial/speed-tweaks/">Linux speed tweak</a> has helped you tweak your Linux computer to make it even more faster! For more Linux tutorials and <a title="Linux Speed Tweaks" href="http://beginnerlinuxtutorial.com/help-tutorial/speed-tweaks/">speed tweaks</a> continue reading through <a title="Beginner Linux Tutorial" href="http://beginnerlinuxtutorial.com">Beginner Linux Tutorial</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/speed-tweaks/fastest-linux-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux chown Command Change Owner</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-chown-command-change-owner/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-chown-command-change-owner/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 20:31:09 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Basic Linux Commands]]></category>
		<category><![CDATA[change group]]></category>
		<category><![CDATA[change Linux permissions]]></category>
		<category><![CDATA[change owner]]></category>
		<category><![CDATA[change permissions]]></category>
		<category><![CDATA[chown command]]></category>
		<category><![CDATA[chown help]]></category>
		<category><![CDATA[file ownership]]></category>
		<category><![CDATA[Linux chown command]]></category>
		<category><![CDATA[linux permissions]]></category>
		<category><![CDATA[man chown]]></category>
		<category><![CDATA[permission error]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=172</guid>
		<description><![CDATA[The Linux chown command is used to change the owner and group of a file or directory. If you have a directory and you are not the owner and would like to be the owner of that directory, you can use the Linux chown command to change the owner to your username. Some of you [...]]]></description>
			<content:encoded><![CDATA[<p>The Linux <code>chown</code> command is used to change the owner and group of a file or directory. If you have a directory and you are not the owner and would like to be the owner of that directory, you can use the Linux <code>chown</code> command to change the owner to your username.</p>
<p>Some of you may get a lot of permission denied errors while trying to open files or folders, this may be caused by improper ownership or owner permissions. If it is a ownership problem, <code>chown</code> will fix your problem. If it is a permission problem, then you will want to look into <code>chmod</code>.</p>
<p>The usage of <code>chown</code> is <code>chown [OPTIONS] [OWNER]:[GROUP] [FILE]</code>. There are many options for <code>chown</code>, but I only use 2 of them on a regular basis. I use <code>chown -R | --recursive</code> and also <code>chown --from=CURRENT_OWNER:CURRENT_GROUP</code>. Basically <code>chown -R</code> is used on directories and all files in that directory. <code>chown --from=CURRENT_OWNER:CURRENT_GROUP</code> is used if you want to only change files that are currently owned by <code>CURRENT_OWNER:CURRENT_GROUP</code>.</p>
<p>For some examples of the Linux <code>chown</code> command. Say I have a desktop computer with Linux on it, and my username on the desktop computer is <code>BrandonStimmel</code>, and I buy a new laptop and install Linux on it, and this time I made my username <code>Brandon</code>. I also want to get rid of my desktop because it is slow and uses a lot of electricity. So I want to copy all of my files and folders from the desktop&#8217;s <code>/home/BrandonStimmel</code> to the laptop&#8217;s <code>/home/Brandon</code>. I simply use <code>rsync</code>, <code>cp</code>, or <code>scp</code> to copy the files and folders from the desktop computer to the laptop computer. Trouble is, I can only read files, I can&#8217;t write to them. I keep getting permission denied errors, and you don&#8217;t have permission to write to the file $FILE. So I login to the laptop as my user, then <code>su</code> to root, since root has permissions to read and write to the files/folders. Then I run <code>chown -R --from=BrandonStimmel:users Brandon:users /home/Brandon/*</code> Some may ask why I used <code>chown --from=</code> in this example. Well I have a ton of files in my home folder from my desktop and I may have some files that were meant to be owned by root, or some other user as backups. I didn&#8217;t want to change all of them to my new username unless I owned them before.</p>
<p>If you use the same example but don&#8217;t care who previously owned the files/folders, you can run <code>chown -R Brandon:users /home/Brandon/*</code> and you will change all files/folders in <code>/home/Brandon</code> to be owned by the username Brandon and the group users.</p>
<p>I hope this <a title="Linux tutorial" href="http://beginnerlinuxtutorial.com">Linux tutorial</a> on the Linux <code>chown</code> command has helped you fix your permission issues. If you have any questions please feel free to contact <a title="Beginner Linux Tutorials" href="http://beginnerlinuxtutorial.com">Beginner Linux Tutorial</a> by leaving a comment or sending an email. Have a great day and remember to read more <a title="Linux tutorials" href="http://beginnerlinuxtutorial.com">Linux tutorials</a>! Knowledge is power, especially with Linux!</p>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-chown-command-change-owner/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux more and less Commands</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-more-and-less-commands/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-more-and-less-commands/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 21:24:40 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Basic Linux Commands]]></category>
		<category><![CDATA[linux command help]]></category>
		<category><![CDATA[linux command tutorials]]></category>
		<category><![CDATA[linux less command]]></category>
		<category><![CDATA[linux less examples]]></category>
		<category><![CDATA[linux less tutorial]]></category>
		<category><![CDATA[linux more command]]></category>
		<category><![CDATA[linux more examples]]></category>
		<category><![CDATA[linux more tutorial]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=165</guid>
		<description><![CDATA[The Linux commands more and less are similar to cat, but with more and less you can scroll the file instead of showing the enter file at once. So if you have larger files you want to view that are longer than your screen or terminal then you can use more or less commands instead [...]]]></description>
			<content:encoded><![CDATA[<p>The Linux commands <code>more</code> and <code>less</code> are similar to <a title="Linux cat Command" href="http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-cat-command/"><code>cat</code></a>, but with <code>more</code> and <code>less</code> you can scroll the file instead of showing the enter file at once. So if you have larger files you want to view that are longer than your screen or terminal then you can use <code>more</code> or <code>less</code> commands instead of <a title="Linux cat Command" href="http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-cat-command/"><code>cat</code></a>.</p>
<p>I would suggest using <code>less</code> more often than <code>more</code> as the Linux <code>less</code> command can load files to the screen faster. If you do <code>more somefile.txt</code> the entire file must be read before it will start displaying on your screen. If you use <code>less somefile.txt</code> the contents of <code>somefile.txt</code> will be displayed as they are read from the file, so you don&#8217;t have to wait until the entire contents are read before you can see it!</p>
<p>Another reason I would suggest using the Linux command <code>less</code> more than the Linux command <code>more</code> is because with <code>less</code> command you can scroll up in the file as well as down, where with the Linux command <code>more</code> you can only scroll down the file. If you pass something with <code>more</code> you have to quit, run the <code>more</code> command again, and hope you don&#8217;t pass what you were looking for again.</p>
<p>The syntax for <code>more</code> is like most Linux commands: <code>more [OPTIONS] [filename]</code>. The sytax for <code>less</code> is the same: <code>less [OPTIONS] [FILENAME]</code>.</p>
<p>The only options I use normally with <code>less</code> is <code>less -N [FILENAME]</code> which will print line numbers before each line. The only options I use on <code>more</code> is <code>more +[number] [FILENAME]</code> which will start you on line [number].</p>
<p>Now for some examples of <code>more</code>.</p>
<p>If I wanted to view file <code>phone-numbers.txt</code> to write them down on paper, or enter into my cellphone, I could run <code>more phone-numbers.txt</code> and hit enter to scroll down after I have already entered the information on my cellphone or wrote them down on paper.</p>
<p>If I was working on a php/mysql website and I click on Login which takes me to login.php and I get something like: <code>PHP parse error : syntax error, unexpected T-STRING on line 130 in file /home/user/www/login.php</code> I can then run <code>more +130 /home/user/www/login.php</code> which will start me on line 130 where the error is so I can look for what is wrong and then fix it.</p>
<p>Now for some examples of <code>less</code>.</p>
<p>If I was working on a php/mysql website and I was writing a <code>foreach()</code> loop on my php script and needed a little help from someone that has a copy of my script, I could do <code>less -N some-script.php</code> and tell him or her what lines I was having problems with.</p>
<p>Well that&#8217;s it for the Linux <code>more</code> and <code>less</code> commands. As always I hope this Linux tutorial on the Linux <code>less</code> and <code>more</code> commands has helped you understand <code>more</code> and <code>less</code> a bit more! Thank you for reading my Linux tutorials on Beginner Linux Tutorial, I hope you have a great day! Any questions of problems with <code>more</code> or <code>less</code> can be asked below in the comment section.</p>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-more-and-less-commands/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Web Hosting Vs Windows Hosting Plan</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/linux-webhosting/linux-web-hosting-vs-windows-hosting-plan/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/linux-webhosting/linux-web-hosting-vs-windows-hosting-plan/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 12:11:24 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Linux Webhosting]]></category>
		<category><![CDATA[advantages of linux]]></category>
		<category><![CDATA[linux hosting]]></category>
		<category><![CDATA[linux server]]></category>
		<category><![CDATA[linux server hosting]]></category>
		<category><![CDATA[linux web hosting]]></category>
		<category><![CDATA[linux web hosting plans]]></category>
		<category><![CDATA[linux website hosting]]></category>
		<category><![CDATA[shared linux hosting]]></category>
		<category><![CDATA[web hosting linux or windows]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=131</guid>
		<description><![CDATA[If you are wanting to build a website, you are probably wondering web hosting, Linux or Windows? I’m going to tell you right now, you want a Linux web hosting service! Here are some reasons why you want to have a Linux web hosting service instead of a Windows web hosting service. The Linux operating [...]]]></description>
			<content:encoded><![CDATA[<p>If you are wanting to build a website, you are probably wondering web hosting, Linux or Windows? I’m going to tell you right now, you want a Linux web hosting service! Here are some reasons why you want to have a Linux web hosting service instead of a Windows web hosting service.</p>
<p>The Linux operating system is <strong>more stable</strong>! This means that the computer that is serving your website to people every day, will not crash as often as Windows. If you are making money from your website selling products or services, you don’t want your website down at all. If your web site goes down, you can’t make any sales!</p>
<p>Linux operating system is <strong>free</strong>! So the web hosting company that owns all these web servers don’t have to pay another $300 to put Windows on each server. Which in turn will pass a slight savings onto you!</p>
<p>Linux is also built for <strong>networking</strong> and <strong>multitasking</strong>. So it can handle more people using the server at the same time without any problems. So if I had a server running Linux I could have 1,000 different customers using this same server. If I take this same exact server and I put Windows on it, I may only be able to have about 500 different customers using the same server. So again it’s cheaper for the Linux web hosting service so they don’t have to buy as many servers. Remember more servers is more money they have to spend on the servers themselves and also the electric to run that server. So again, you get a little bit of these saving passed onto you!</p>
<p>Linux servers are also <strong>more secure</strong>! There are many ways Linux is more secure, but the main reasons here, is account security! Your account is safer from hackers if your web hosting service is using Linux. Your customers credit cards and such are safer from attacks. Also your website is safer, so attackers don’t break your website, change your website, or even steal your files!</p>
<p>Linux <strong>can not</strong> get computer <strong>viruses</strong>! So your account will be safe from computer viruses ruining your data, stealing customer username, passwords, credit card numbers, etc.</p>
<p>So if you are wanting to check out some Linux web hosting services, below are some Linux web hosts that <a title="Linux tutorials" href="http://beginnerlinuxtutorial.com">Beginner Linux Tutorial</a> recommends:<br />
<strong>NOTE</strong>: If you want full details of each Linux web host please check out our <a title="Linux webhosting" href="http://beginnerlinuxtutorial.com/help-tutorials/linux-webhosting/">Linux Web Hosting</a> section!</p>
<ul>
<li><a title="Linux web hosting bluehost" onmouseover="window.status='http://www.bluehost.com';return true;" onmouseout="window.status=' ';return true;" href="http://www.kqzyfj.com/gt97dlurlt8CB9BDED8A9CGFGCD?sid=linux" target="_blank">Bluehost</a><img src="http://www.lduhtrp.net/8g104jy1qwuFJIGIKLKFHGJNMNJK" border="0" alt="bluehost Linux web hosting" width="1" height="1" /></li>
<li><a title="Linux just host web host" onmouseover="window.status='http://www.justhost.com';return true;" onmouseout="window.status=' ';return true;" href="http://www.tkqlhce.com/cf81ar-xrzEIHFHJKJEGFKLOHIH?sid=linux" target="_blank">JustHost</a><img src="http://www.lduhtrp.net/ao104snrflj487579A9465ABE787" border="0" alt="just Linux web host" width="1" height="1" /></li>
<li><a title="Linux webhost powweb" onmouseover="window.status='http://www.powweb.com';return true;" onmouseout="window.status=' ';return true;" href="http://www.tkqlhce.com/68104zw41w3JNMKMOPOJLLROTOK?sid=linux" target="_blank">PowWeb</a><img src="http://www.awltovhc.com/af100wquiom7BA8ACDC799FCHC8" border="0" alt="Linux webhost powweb" width="1" height="1" /></li>
<li><a title="linux web hosting with host gator" onmouseover="window.status='http://www.hostgator.com';return true;" onmouseout="window.status=' ';return true;" href="http://www.jdoqocy.com/f281qgpmgo37646898354854C55?sid=linux" target="_blank">HostGator</a><img src="http://www.ftjcfx.com/l4117fz2rxvGKJHJLMLGIHLIHPII" border="0" alt="Linux web hosting with host gator" width="1" height="1" /></li>
<li><a title="Linux webhosting host monster" onmouseover="window.status='http://www.hostmonster.com';return true;" onmouseout="window.status=' ';return true;" href="http://www.dpbolvw.net/id102hz74z6MQPNPRSRMONRPPOSS?sid=linux" target="_blank">HostMonster</a><img src="http://www.lduhtrp.net/m7122jy1qwuFJIGIKLKFHGKIIHLL" border="0" alt="Linux webhosting host monster" width="1" height="1" /></li>
<li><a title="Linux webhosting service ipower" onmouseover="window.status='http://www.iPower.com';return true;" onmouseout="window.status=' ';return true;" href="http://www.kqzyfj.com/18103xdmjdl04313565021511728?sid=linux" target="_blank">iPower</a><img src="http://www.ftjcfx.com/7i117snrflj487579A9465955B6C" border="0" alt="ipower web hosting linux" width="1" height="1" /></li>
<li><a title="Linux webhosting plan" onmouseover="window.status='http://www.easycgi.com';return true;" onmouseout="window.status=' ';return true;" href="http://www.dpbolvw.net/5q70wktqks7BA8ACDC7H999DDA?sid=linux" target="_blank">EasyCGI</a><img src="http://www.awltovhc.com/ke104ltxlrpAEDBDFGFAKCCCGGD" border="0" alt="easy Linux web hosting" width="1" height="1" /></li>
<li><a title="fast linux domain web hosting" onmouseover="window.status='http://www.fastdomain.com';return true;" onmouseout="window.status=' ';return true;" href="http://www.jdoqocy.com/7s97lnwtnvAEDBDFGFACBGBJIJI?sid=linux" target="_blank">FastDomain</a><img src="http://www.awltovhc.com/2581xjnbhf04313565021619898" border="0" alt="fast Linux domain web hosting" width="1" height="1" /></li>
<li><a title="godaddy Linux web hosting plans" onmouseover="window.status='http://www.godaddy.com';return true;" onmouseout="window.status=' ';return true;" href="http://www.dpbolvw.net/3977iqzwqyDHGEGIJIDFEHLMINI?sid=linux" target="_blank">GoDaddy</a><img src="http://www.awltovhc.com/t8118iw-ousDHGEGIJIDFEHLMINI" border="0" alt="godaddy linux web hosting" width="1" height="1" /></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/linux-webhosting/linux-web-hosting-vs-windows-hosting-plan/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux grep Command</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 18:34:25 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Basic Linux Commands]]></category>
		<category><![CDATA[grep command]]></category>
		<category><![CDATA[grep extracting data examples]]></category>
		<category><![CDATA[grep quick reference guide]]></category>
		<category><![CDATA[grep syntax]]></category>
		<category><![CDATA[grep tutorial]]></category>
		<category><![CDATA[grep two different strings from one file in linux terminal]]></category>
		<category><![CDATA[linux examples grep command]]></category>
		<category><![CDATA[linux grep command]]></category>
		<category><![CDATA[linux grep tutorial]]></category>
		<category><![CDATA[unix grep]]></category>
		<category><![CDATA[unix grep command]]></category>
		<category><![CDATA[unix grep examples]]></category>
		<category><![CDATA[wildcard in grep]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=127</guid>
		<description><![CDATA[The Linux grep command is used to extract lines of data from files or extract data from other Linux commands by using a pipe. When using the Linux grep command, there are many ways you can extract or print lines. You can use standard text to grep or you can use regex patterns. When using [...]]]></description>
			<content:encoded><![CDATA[<p>The Linux <code>grep</code> command is used to extract lines of data from files or extract data from other Linux commands by using a pipe. When using the Linux <code>grep</code> command, there are many ways you can extract or print lines. You can use standard text to <code>grep</code> or you can use regex patterns. When using regex patterns you can use basic regular expression (BRE), extended regular expression (ERE), or even a Perl regular expression!</p>
<p>There are many different <code>grep</code> options you can use in the <code>grep</code> syntax. I myself only use a few options with <code>grep</code> on a regular basis. The basic <code>grep</code> syntax is <code>grep [options] [pattern] [file|files]</code>.</p>
<p><code>grep</code> quick reference guide:</p>
<p>You can use <code>grep -R</code>, <code>grep -r</code>, <code>grep --recursive</code>, which will allow you to have <code>grep</code> parse files recursivley into other directories.</p>
<p>If you are working with code, or just want the output lines to be numbered you can use <code>grep -n</code> or <code>grep --line-number</code>.</p>
<p>Another option I use on a daily basis with <code>grep</code> is <code>grep -i</code> or <code>grep --ignore-case</code>, which will ignore case on both the input file, and the pattern. by default <code>grep</code> is case sensitive, so you have to use this option if you do not want it case sensitive.</p>
<p>If you are wanting to extract multiple patterns from your file, you can use <code>grep -e</code> which can be used multiple times to extract multiple patterns from your file. So if you are wanting to <code>grep</code> two different strings from one file in Linux, you could do <code>grep -e firstpattern -e secondpattern /home/$USER/file.txt</code>.</p>
<p>Here are some <code>grep</code> examples of using the Linux <code>grep</code> command:</p>
<p>If I had a plain text file called <code>phone-book.txt</code>, that had phone numbers listed in this order: <code>First Name Last Name - Street Address - Phone Number</code><br />
Now I want to get Brandon Stimmel&#8217;s phone number. I could run <code>grep Brandon\ Stimmel phone-book.txt</code> and <code>grep</code> would print <code>Brandon Stimmel - 100101 Digital Ave. Tech, Ohio 44333 (330) 222-7222</code>. Notice I used <code>Brandon\ Stimmel</code>, I did this because you can not use a space on the command line, or it will be parsed as the next section of the command, which <code>grep Brandon Stimmel phone-book.txt</code> without the <code>\</code> would try to extract Brandon from the file Stimmel, which doesn&#8217;t exist. So remember to escape your spaces with a <code>\</code> if you are using them in your pattern/search string.</p>
<p>For another example, if I want to bring up who owns the phone number (330) 222-7222 as it showed up on my caller ID, but I forgot who&#8217;s phone number it was, I can do <code>grep \(330\)\ 222-7222 phone-book.txt</code> which would again display: <code>Brandon Stimmel - 100101 Digital Ave. Tech, Ohio 44333 (330) 222-7222</code>.</p>
<p>You can also <code>grep</code> for just the last name, say if you are having a family reunion and you want to bring up all of the people with the last name of Stimmel. <code> grep Stimmel phone-book.txt</code> this will bring up every person in <code>phone-book.txt</code> that has the last name of Stimmel.</p>
<p>You can also pipe data to <code>grep</code> or pipe data from <code>grep</code> to use it in a bash script. Say if you are wanting to do the above example that you found a phone number and forgot who&#8217;s it was, but you don&#8217;t want to show the entire line with name, address, and number, you just want the name and only the name. <code>grep \(330\)\ 222-7222 phone-book.txt|awk '{print $1" "$2}'</code> which will output <code>Brandon Stimmel</code>. The <code>grep</code> part of this code will output the full string, then we pass that data onto <code>awk</code> which we used it to print only the first and second fields.</p>
<p>Well that&#8217;s it for the <code>grep</code> tutorial, for now anyways. As always, thank you for reading our <a href="http://beginnerlinuxtutorial.com" title="Linux Tutorials">Linux Tutorials</a> and I hope you find these <a href="http://beginnerlinuxtutorial.com" title="Linux Tutorials">Linux Tutorials</a> very helpful! Remember to bookmark <a href="http://beginnerlinuxtutorial.com" title="Beginner Linux Tutorials">Beginner Linux Tutorial</a> so you can always come back and find more helpful <a href="http://beginnerlinuxtutorial.com" title="Linux Tutorials">Linux Tutorials</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Linux cat Command</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-cat-command/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-cat-command/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 17:07:16 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Basic Linux Commands]]></category>
		<category><![CDATA[cat linux]]></category>
		<category><![CDATA[linux cat]]></category>
		<category><![CDATA[linux cat command]]></category>
		<category><![CDATA[pipeline cat with other commands linux terminal]]></category>
		<category><![CDATA[unix command list file contents]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=119</guid>
		<description><![CDATA[In this Linux tutorial you will learn how to use the Linux cat command. The Linux cat command is the Unix command to list a file&#8217;s contents onto your screen, or pass via pipeline to use with other Linux commands. The cat command comes from the word concatenate. The usage of the Linux cat command [...]]]></description>
			<content:encoded><![CDATA[<p>In this Linux tutorial you will learn how to use the Linux <code>cat</code> command. The Linux <code>cat</code> command is the Unix command to list a file&#8217;s contents onto your screen, or pass via pipeline to use with other Linux commands. The <code>cat</code> command comes from the word concatenate.</p>
<p>The usage of the Linux <code>cat</code> command is <code>cat [options] [file]</code>.</p>
<p>There are quite a few options you can use with the Linux <code>cat</code> command, but I rarely use any of them on a regular basis. The only option I use with the <code>cat</code> command on a regular basis is <code>cat -n</code> or <code>cat --number</code>.</p>
<p>For an example of using the <code>cat</code> command, we&#8217;ll say I have a file named Linux-Friends.txt and in this text file I have some friend&#8217;s names, phone numbers, and e-mail addresses that run Linux. So now I want to get someone&#8217;s phone number from this list. I can run <code>cat Linux-Friends.txt</code> in a Linux terminal and I will get the contents of this file listed on my screen.</p>
<p>Now if I wanted to see how many friends I have listed in this file, I can have <code>cat</code> number the lines for me by using the <code>cat -n</code> option. So if I run <code>cat -n Linux-Friends.txt</code> the <code>cat</code> command will then output each of the Linux friend&#8217;s that I have listed and place a number in front of each one so I can see how many friends I have. Using <code>cat -n [file]</code> is also useful when doing some programming or coding, so you can see what line number you need to edit.</p>
<p>You can also pipe off of the Linux <code>cat</code> command to use it with other Linux commands. So for this example of the Linux <code>cat</code> command I want to only grab a certain person&#8217;s name from the list to display their contact information. So I can run <code>cat Linux-Friends.txt|</code><a title="linux grep command tutorial" href="http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/"><code>grep</code></a><code> Brandon</code> and now I will only get Brandon&#8217;s contact information.</p>
<p>Another example of using the Linux <code>cat</code> command with other Linux commands via pipe is if I only want Brandon&#8217;s email address to display and not his phone number. The Linux-Friends.txt file is in this format: last name, first name &#8211; phone number &#8211; email address so I can use the Linux <code>cat</code> command with <a href="http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/" title="Linux grep command"><code>grep</code></a> and also <code>awk</code> to display only what I want. So I can run <code>cat Linux-Friends.txt|</code><a title="Linux grep command tutorials" href="http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/"><code>grep</code></a><code> Brandon|awk '{print $4" "$5}'</code> and now I have Brandon&#8217;s phone number.</p>
<p>For an explaination of the command above I will show each output as each command is ran.<br />
<code>cat Linux-Friends.txt</code><br />
&#8211;friend 1,2,3&#8211;<br />
Stimmel, Brandon &#8211; (330) 222-7222 &#8211; news@beginnerlinuxtutorial.com<br />
&#8211;friend 5,6,7&#8211;<br />
Now we add <code>|</code><a href="http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/" title="Linux grep tutorial"><code>grep</code></a><code> Brandon</code><br />
Stimmel, Brandon &#8211; (330) 222-7222 &#8211; news@beginnerlinuxtutorial.com<br />
and you see the other friends are now gone. Now we can add <code>|awk '{print $4" "$5}'</code> which will display the 4th and 5th column, and the &#8211; in that file counts as a column as well. The 4th column is (330) and the 5th column is 222-7222. So my output now would be: (330) 222-7222</p>
<p>I hope this has helped you learn how to use the Linux <code>cat</code> command in a Linux terminal and also using the <code>cat</code> command with other commands via pipeline. Remember to come back and visit <a title="Beginner Linux Tutorial" href="http://beginnerlinuxtutorial.com">Beginner Linux Tutorial</a> for all of your Linux questions and tutorials. If there is a Linux tutorial you&#8217;d like to see on <a title="Beginner Linux Tutorial" href="http://beginnerlinuxtutorial.com">Beginner Linux Tutorial</a> please let us know.</p>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-cat-command/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Delete in Linux Terminal rm Command</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/how-to-delete-in-linux-terminal-rm-command/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/how-to-delete-in-linux-terminal-rm-command/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 20:11:11 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Basic Linux Commands]]></category>
		<category><![CDATA[how to delete in linux terminal]]></category>
		<category><![CDATA[how to remove a file with linux]]></category>
		<category><![CDATA[linux delete command]]></category>
		<category><![CDATA[linux delete file]]></category>
		<category><![CDATA[linux delete file command]]></category>
		<category><![CDATA[linux reference rm]]></category>
		<category><![CDATA[linux remove directories]]></category>
		<category><![CDATA[remove directory linux]]></category>
		<category><![CDATA[remove file found after grep in linux]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=116</guid>
		<description><![CDATA[Many Linux users get confused when they are in a Linux terminal and trying to delete files of folders. So in this Linux tutorial, I will cover how to delete files in Linux terminal! The Linux delete command is another basic command that is used everyday while in a Linux terminal. There are only 2 [...]]]></description>
			<content:encoded><![CDATA[<p>Many Linux users get confused when they are in a Linux terminal and trying to delete files of folders. So in this Linux tutorial, I will cover how to delete files in Linux terminal! The Linux delete command is another basic command that is used everyday while in a Linux terminal. There are only 2 options that I use on a regular basis with the Linux <code>rm</code> command.</p>
<p>The usage of the Linux <code>rm</code> command is <code>rm [options] [file|dir]</code>. The 2 options I use most is <code>rm -r [dir]</code> and <code>rm -f [file]</code>. Now to explain these options for the Linux delete command and also give you some examples on how to remove a file with Linux.</p>
<p>The <code>rm -f [file]</code> option is if you are wanting to force a file to be removed. This will not ask you &#8220;are you sure you want to remove [file]&#8220;. It will just delete the file regardless. So use this option for the Linux <code>rm</code> command only if you know you want all of the file(s) deleted.</p>
<p>Now the <code>rm -r [dir]</code> option is if you are wanting to delete a directory in Linux. The <code>rm -r</code> option is to specify to remove recursively, meaning a directory and it&#8217;s contents.</p>
<p>You can use these 2 options for the Linux delete command together as well. You could use the command <code>rm -rf [dir]</code> to delete a directory forcefully and recursively. <strong>DO NOT</strong> be fooled into running <code>rm -rf /</code>, <code>rm -rf /*</code> as this will remove all of your files and folders. Some people may come off as they are trying to help you with Linux and be a dick and tell you to run <code>rm -rf /*</code> which you can then say bye bye to your files and folders.</p>
<p>You can also use <code>rm</code> in a script type command after a pipe <code>|</code> so you can delete filenames of the output. You can also use <code>rm</code> to remove files that are produced from another command or script. Here is an example of how to remove a file found after <a href="http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/" title="Linux grep tutorial"><code>grep</code></a> in Linux. Say if you have a folder <code>/home/max/images/family</code> and in this directory you have 20 images that have the word copy in the title because you accidentally highlighted these 20 files, went to drag them into another folder in a GUI, and let go too early and created copies. So now you want to remove these copies, you would first <code>cd</code> to that directory <code>cd /home/max/images/family</code> now you can run <code>rm -f `ls | </code><a href="http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/" title="grep Linux tutorial"><code>grep</code></a><code> copy`</code> which will remove all the files that <code>ls | </code><a href="http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/linux-grep-command/" title="grep Linux tutorials"><code>grep</code></a><code> copy</code> matches. This same process could be done easier by running <code>rm -f *copy*</code> instead, but these are just examples.</p>
<p>I hope reading this Linux tutorial on the Linux <code>rm</code> command has taught you more than you already know and that you can continue reading through this Beginner Linux Tutorial website and learn even more about the Linux operating system! Have a great day and remember <strong>DO NOT</strong> run <code>rm -rf /*</code> or any variation of it. I will write a section on Beginner Linux Tutorial explaining more of the commands that can harm your system to watch out for when people are trying to help you with Linux so that you will not be a victim of this. If you are unsure if a command will harm your system, you can always do a quick reference check by searching the net for that command, or even looking at the man pages for that command to see what it is that command/options will do. You can read your manpages by typing <code>man [command]</code> like <code>man rm</code> will bring up the manual for the Linux <code>rm</code> command.</p>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/how-to-delete-in-linux-terminal-rm-command/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to Move Files in Linux mv Command</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/how-to-move-files-in-linux-mv-command/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/how-to-move-files-in-linux-mv-command/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 08:52:22 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Basic Linux Commands]]></category>
		<category><![CDATA[how to move files in linux]]></category>
		<category><![CDATA[linux find and move files]]></category>
		<category><![CDATA[linux find to move files]]></category>
		<category><![CDATA[linux move files with special characters]]></category>
		<category><![CDATA[linux using find to move files]]></category>
		<category><![CDATA[move accounts to new linux server]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=109</guid>
		<description><![CDATA[If you are wanting to know how to move files in Linux, you will need to use the Linux mv command. There are a few different options you can use with the Linux mv command, but I normally don&#8217;t use them. I do use the Linux mv command along with other commands to accomplish some [...]]]></description>
			<content:encoded><![CDATA[<p>If you are wanting to know how to move files in Linux, you will need to use the Linux <code>mv</code> command. There are a few different options you can use with the Linux <code>mv</code> command, but I normally don&#8217;t use them. I do use the Linux <code>mv</code> command along with other commands to accomplish some tasks though. If you wanted to get information on the other options for the Linux <code>mv</code> command, remember you can always run <code>man mv</code> in a bash shell prompt.</p>
<p>The usage of the Linux <code>mv</code> command to move files around on your file system is much like the Linux <code>cp</code> command, but the source will no longer exist. To use the <code>mv</code> command in Linux shell, just run <code>mv [source] [destination]</code>.</p>
<p>So for example I am making a new account on another Linux computer. I want to move my home directory to the new Linux computer. So first I setup nfs and <code>mount</code> my new Linux computer&#8217;s <code>/home</code> directory on my old Linux computer. Now I will run <code>mv /home/max /mnt/home/</code> so all of my files move to my new Linux computer. This is just an example as I would most likely use <code>rsync</code> Linux command to do this. Which I will go over in another Linux tutorial.</p>
<p>I have also seen a few Linux beginners having trouble moving files in Linux that have special characters in them. So to move files with special characters in Linux you will simple escape the characters that hold special meanings, like a space, (, or ). So for example I have a file named <code>DSC06540 (New LCD TV).JPG</code> this is an ugly filename but to move this file from my compact flash drive on my camera to my <code>/home/max/images/electronics</code> directory, I would simple escape all the special characters with a <code>\</code> like this <code>mv /media/CF/DSC06540\ \(New\ LCD\ TV\).JPG /home/max/images/electronics/</code></p>
<p>Another command I use quite often with the <code>mv</code> shell command is <code>find</code>. I can have <code>find</code> search for files on my computer and move the files to a new location. To do this there are 2 methods you can use, one method of using Linux <code>find</code> to move files is a small script, for example if I want to move all my php files to <code>/home/max/htdocs/</code> I would run this: <code>for i in `find *php`; do mv $i /home/max/htdocs; done</code>.</p>
<p>Method 2 that uses Linux <code>find</code> command to move files in Linux is using the <code>-exec</code> option of <code>find</code> to execute <code>mv</code>. This command was brought to my attention a few days ago by another Linux user, and it is much faster than my method. Using the same example to move my php files, but using this method, you will run: <code>find *php -exec mv {} /home/max/htdocs \;</code> which is a lot less to type!</p>
<p>You can also change your <code>find</code> options any way you prefer to search your hard drive for the files you are looking for. Which I will go over in another Linux tutorial.</p>
<p>As you can see it isn&#8217;t hard at all to move files and folders in Linux shell prompt at all. As always I hope this Linux tutorial for beginners has helped you learn more about the Linux <code>mv</code> command. I hope you come back and find more help on Beginner Linux Tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/how-to-move-files-in-linux-mv-command/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>cp Linux Copy Command</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/cp-linux-copy-command/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/cp-linux-copy-command/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 09:40:59 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Basic Linux Commands]]></category>
		<category><![CDATA[copy files in linux]]></category>
		<category><![CDATA[how to cp files into default directory in linux]]></category>
		<category><![CDATA[linux copy]]></category>
		<category><![CDATA[linux copy command]]></category>
		<category><![CDATA[linux copy hidden files]]></category>
		<category><![CDATA[linux cp]]></category>
		<category><![CDATA[unix cp command]]></category>
		<category><![CDATA[unix cp command examples]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=89</guid>
		<description><![CDATA[The Linux copy command is cp! Pretty simple right? There are many ways to use the Linux cp command. There are also many options for the cp command, but I usually only use 2 of them daily. The other options for Unix cp command I hardly use because there are other commands or programs in [...]]]></description>
			<content:encoded><![CDATA[<p>The Linux copy command is <code>cp</code>! Pretty simple right? There are many ways to use the Linux <code>cp</code> command. There are also many options for the <code>cp</code> command, but I usually only use 2 of them daily. The other options for Unix <code>cp</code> command I hardly use because there are other commands or programs in Linux that do a much better job for accomplishing the same tasks. So for the other options for the Linux copy command, I will not cover them in this tutorial. If there is some specific <code>cp</code> command usage or syntax you want to know, please let me know and I will add it to this Linux tutorial.</p>
<p>The 2 options for the Linux <code>cp</code> command that I will cover is how to copy file recursively and also how to copy files in Linux only if the source file is newer than the destination file.</p>
<p>First the syntax for using the Linux <code>cp</code> command is <code>cp  [options] [source] [destination]</code>, where <code>[source]</code> or <code>[destination]</code> may be a file or a directory.</p>
<p>The main option for the Linux <code>cp</code> command that I use is coping a directory recursively. To do this you would use <code>cp -R [source] [destination]</code>, <code>cp -r [source] [destination]</code>, or <code>cp --recursive [source] [destination]</code>. I usually am lazy and just use the shortest easiest keystroke, <code>cp -r [source] [destination]</code>.</p>
<p>Coping a directory recursively means copying the entire folder, including it&#8217;s contents. For example if I was wanting to copy the directory <code>/home/max/images/family/</code> and all of the directories and files inside of it to <code>/media/backup_drive/</code>, I would run <code>cp -r /home/max/images/family /media/backup_drive/</code></p>
<p>Now if I was not wanting to copy the entire directory and just wanted only the *.jpg files, I would not need the <code>-r</code> option. I would simply run <code>cp /home/max/images/family/*.jpg /media/backup_drive/family/jpeg_files/</code> which <code>*</code> is a wildcard, so anything.jpg will be copied. Yes, that is a bad example as that is a very ugly directory structure, but again it is about 4:30am and I should really be sleeping!</p>
<p>There are much better ways to backup your data in Linux than using the <code>cp</code> command, that is the only example I could come up with at the moment. In another Linux tutorial I will cover how to backup your files in Linux using a lot more efficient methods.</p>
<p>The next option that I use from time to time on the Unix <code>cp</code> command is <code>cp -u [source] [destination]</code> or <code>cp --update [source] [destination]</code> which will only copy files if the source files are newer than the destination files, or if the destination files do not exist.</p>
<p>For an example of the Linux <code>cp -u</code> command I am wanting to copy files from my website and back them up, but I only want to copy the files that are newer, to save CPU usage and drive writes, no use in overwriting files that are the same or older right? So I will run <code>cp -u /home/max/htdocs/* /media/backup_drive/htdocs/</code></p>
<p>If you are wanting to copy hidden files and folders in Linux using the <code>cp</code> command, the first thing people will think of is <code>cp -r .* /media/backup_drive/max/hidden_config_files/</code> but this will actually match <code>./</code> and <code>../</code> as well, which will copy all files in the current working directory, and also copy all the files from the parent directory. So to copy only hidden files in Linux, you would want to run <code>cp -r .[a-z,A-Z,0-9]* /media/backup_drive/max/hidden_config_files/</code> this way it will only match files that start with a . and the next character is a-z, A-Z, or 0-9 and everything after that being a wildcard.</p>
<p>I hope this Linux tutorial on the Linux <code>cp</code> command for beginners has helped you understand how to use the Unix <code>cp</code> command while in the Linux Command Line Interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/cp-linux-copy-command/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Change Directory using cd Linux Command</title>
		<link>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/change-directory-using-cd-linux-command/</link>
		<comments>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/change-directory-using-cd-linux-command/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 08:40:48 +0000</pubDate>
		<dc:creator>Beginner Linux Tutorial</dc:creator>
				<category><![CDATA[Basic Linux Commands]]></category>
		<category><![CDATA[cd shell command]]></category>
		<category><![CDATA[change directory cd]]></category>
		<category><![CDATA[change directory command prompt]]></category>
		<category><![CDATA[change directory linux]]></category>
		<category><![CDATA[change directory with space shell]]></category>
		<category><![CDATA[change working directory]]></category>
		<category><![CDATA[how to change directories in the command prompt]]></category>
		<category><![CDATA[linux cd command]]></category>

		<guid isPermaLink="false">http://beginnerlinuxtutorial.com/?p=82</guid>
		<description><![CDATA[In this Linux tutorial for beginners, you will learn how to change directories in Linux using the cd command. The Linux cd command is very easy to use. There are a couple options you can use with the cd command, but I won&#8217;t cover them as I hardly ever use them. I will show you [...]]]></description>
			<content:encoded><![CDATA[<p>In this Linux tutorial for beginners, you will learn how to change directories in Linux using the <code>cd</code> command. The Linux <code>cd</code> command is very easy to use. There are a couple options you can use with the <code>cd</code> command, but I won&#8217;t cover them as I hardly ever use them. I will show you how to use some common variables with the Linux <code>cd</code> command though.</p>
<p>When using the Linux <code>cd</code> command to change directory, the syntax of the Unix <code>cd</code> command is <code>cd [directory]</code>. Pretty easy to remember right? So if you are wanting to change your current working directory to your home directory, you can run <code>cd /home/max</code> as max is my username. With the <code>cd</code> command if you do not specify any directory it will automatically change directory to your home, so just running <code>cd</code> in the Linux shell will take you to your home directory as well. Another way to get to your home directory in Linux is using the home variable <code>$HOME</code>. So if you type <code>cd $HOME</code> you will be taken to your user&#8217;s home directory as well.</p>
<p>You can also use the <code>$HOME</code> variable as part of a path. Say if you wanted to change directory to <code>/home/max/images/family</code> you could run <code>cd $HOME/images/family</code> which will take you to <code>/home/max/images/family</code> but of course your <code>$HOME</code> not mine!</p>
<p>Some other common uses of the Linux <code>cd</code> command is to change directory to the parent directory. To do this you could use <code>cd ../</code> which will change directory to the parent directory of the active directory you are already in. You can also use <code>../</code> as part of your path, so say my current working directory is <code>/home/max/images/family</code> and I want to change directory to <code>/home/max/images/friends</code> you have 2 options. You can run the <code>cd</code> command with the full path: <code>cd /home/max/images/friends</code> or your other option is to use the <code>../</code> parent directory as part of your path like this: <code>cd ../friends/</code> since I was already in <code>/home/max/images/family</code> the parent directory is <code>/home/max/images/</code></p>
<p>One more common thing I see some people asking is how to change to a directory with a space in the shell. When you are in the command line interface a space is a special character so you will have to escape it using a backslash <code>\</code> I usually try not to make any filenames or directory names with any special characters in them, but if you do have a directory named say <code>Linux Stuff</code> you would use <code>cd Linux\ Stuff</code> to change directories.</p>
<p>You can also use the <code>cd</code> shell command to change directory as part of a script. For example if I was wanting to make a script that would change directory to <code>/usr/local/games/quake3</code> and then run <code>./quake3</code> since the quake3 game needs your shell to be in <code>/usr/local/games/quake3</code> as the working directory for the game to run properly, you could run <code>cd /usr/local/games/quake3 &#038;&#038; ./quake3</code> which you can save to a file in <code>/usr/bin/quake3</code> so when you run <code>quake3</code> the shell script will <code>cd /usr/local/games/quake3</code> and if that runs with no errors the shell script will then also run <code>./quake3</code></p>
<p>At the moment I am pretty tired, so the quake3 game was the only thing I could think of off the top of my head that you would want to script the Linux <code>cd</code> command.</p>
<p>I hope this <code>cd</code> Linux tutorial for beginners has helped you learn more about the Linux shell command <code>cd</code> so you can change directories easily using the Linux shell. Remember to come back and visit Beginner Linux Tutorial for more Linux tutorials for beginners as this site will always be adding more Linux tutorials.</p>
]]></content:encoded>
			<wfw:commentRss>http://beginnerlinuxtutorial.com/help-tutorial/basic-linux-commands/change-directory-using-cd-linux-command/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
