<?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>OpenPeta &#187; Basic Commands</title>
	<atom:link href="http://openpeta.com/index.php/category/basic-commands/feed/" rel="self" type="application/rss+xml" />
	<link>http://openpeta.com</link>
	<description>Open Mind ....  Open Source ...</description>
	<lastBuildDate>Wed, 21 Jul 2010 03:20:44 +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>10 Basic Linux Commands</title>
		<link>http://openpeta.com/index.php/2010/05/10-basic-linux-commands/</link>
		<comments>http://openpeta.com/index.php/2010/05/10-basic-linux-commands/#comments</comments>
		<pubDate>Sat, 08 May 2010 09:41:47 +0000</pubDate>
		<dc:creator>ANTHONIRAJ</dc:creator>
				<category><![CDATA[Basic Commands]]></category>
		<category><![CDATA[Linux on NoteBook PCs]]></category>
		<category><![CDATA[Ubuntu Linux]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/?p=868</guid>
		<description><![CDATA[1. Man &#8211; Online Manual Page for Linux Commands Displaying Manual or Help Page # man find Getting Short Description # man -f ifconfig Getting List of commands using keyword # man -k &#8220;network&#8221; Converting Manual Page into Portable Format [ Text , PDF , PS ] For Text File conversion # man ls &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>1. <strong>Man</strong> &#8211; Online Manual Page for Linux Commands</p>
<ul>
<li>Displaying 	Manual or Help Page</li>
</ul>
<p style="padding-left: 60px;"><strong># </strong><strong>man find </strong></p>
<ul>
<li>Getting 	Short Description</li>
</ul>
<p style="padding-left: 60px;"><strong># man  -f  ifconfig</strong></p>
<ul>
<li>Getting 	List of commands using keyword</li>
</ul>
<p style="padding-left: 60px;"><strong> # man -k &#8220;network&#8221;</strong></p>
<ul>
<li>Converting 	Manual Page into Portable Format [ Text , PDF , PS ]</li>
</ul>
<ul>
<li>
<ul>
<li>For 	Text File conversion<br />
<strong># 	man ls | col -b &gt; lstext.txt</strong></li>
</ul>
<ul>
<li>For 	PDF or PS conversion<strong># man -t ls &gt; 	lsps.ps </strong>
<p><strong> # man -t ls | ps2pdf &#8211; &gt; lstext.pdf</strong></li>
</ul>
</li>
</ul>
<p>2. <strong>apropos </strong>-  search the command short description with the given keyword</p>
<ul>
<li>General 	Syntax</li>
</ul>
<p style="padding-left: 60px;"><strong>#apropos &#8220;print&#8221; </strong></p>
<ul>
<li>Pattern 	Matching</li>
</ul>
<p style="padding-left: 60px;"><strong>#apropos -r &#8220;^[p]+[g]$&#8221;</strong></p>
<p>[This pattern will match the command description word</p>
<p>starting with "p" and ends with "g" ] <strong> </strong></p>
<p>3. <strong>cd</strong> &#8211; changing the current directoy to some destination directory</p>
<p style="padding-left: 60px;"><strong># pwd </strong> [ Current Working Directory]</p>
<p style="padding-left: 60px;"><strong># cd /opt/ </strong>[chnage to /opt]</p>
<p style="padding-left: 60px;"><strong># cd .. </strong>[ change to root]</p>
<p>4. <strong>ls </strong>- List Directories and Files</p>
<p style="padding-left: 60px;"><strong># ls </strong>[ display all files and folders ]</p>
<p style="padding-left: 60px;"><strong># ls -l </strong>[ display files with all information ]</p>
<p style="padding-left: 60px;"><strong># ls -a </strong>[ display hidden files also ]</p>
<p style="padding-left: 60px;"><strong># ls -R </strong>[ display the folder contents ]</p>
<p style="padding-left: 60px;"><strong># ls -i </strong>[ display the index number of each file ]</p>
<p>5.<strong>cp  &#8211; </strong>copying folders and files from source to  destination.</p>
<ul>5.1 Copying 	Files</ul>
<p style="padding-left: 60px;">#<strong> cp kavidhai.pdf /opt/</strong></p>
<p style="padding-left: 60px;">[copy the file kavithai.pdf into /opt folder]</p>
<p style="padding-left: 60px;"><strong># cp kavidhai.pdf sam.txt /opt/</strong></p>
<p style="padding-left: 60px;">[copy the files kavithai.pdf and sam.txt into /opt folder ]</p>
<ul style="padding-left: 60px;">5.2 Copying 	Folders</ul>
<p style="padding-left: 60px;"><strong># cp -r uploads/ /opt/ </strong></p>
<p style="padding-left: 60px;">[Copy the folder uploads and its content into /opt folder]</p>
<p>6.  <strong>rm</strong> &#8211; delete files and folders</p>
<p style="padding-left: 60px;"><strong># cd /opt/uploads </strong></p>
<p style="padding-left: 60px;"><strong> # rm kavidhai.pdf </strong></p>
<p style="padding-left: 60px;">[Delete kavithai.pdf from uploads folder ]</p>
<p style="padding-left: 60px;"><strong># cd .. </strong></p>
<p style="padding-left: 60px;"><strong> # rm -r uploads/</strong></p>
<p style="padding-left: 60px;">[Delete the folder uploads/ and its content  from /opt]</p>
<p>7. <strong>cat </strong>- create ,display and concatenate the file (s)</p>
<p>7.1 Create new file</p>
<p style="padding-left: 60px;"><strong># cat &gt; sample.txt </strong></p>
<p style="padding-left: 60px;">Hello</p>
<p>[This syntax will create new textfile you can use ctrl+c</p>
<p>for saving and exit from the editor. ]</p>
<p>7.2  Dispaly the file contents [Read Only]</p>
<p style="padding-left: 60px;"><strong>#cat sample.txt </strong></p>
<p style="padding-left: 60px;">Hello</p>
<p>7.3 Concatenating Files</p>
<p style="padding-left: 60px;"><strong># cat &gt; sample1.txt </strong></p>
<p style="padding-left: 60px;">Welcome to OpenPeata</p>
<p style="padding-left: 60px;">^C</p>
<p style="padding-left: 60px;"><strong># cat sam.txt sample1.txt </strong></p>
<p style="padding-left: 60px;">Hello</p>
<p style="padding-left: 60px;">Welcome to OpenPeata</p>
<p>8. <strong>history  &#8211; </strong>User commands in terminal  will be stored into hitory configuration file.</p>
<p style="padding-left: 60px;"><strong># history | tail  -2</strong></p>
<p style="padding-left: 60px;">48  cat &gt; sam.txt</p>
<p style="padding-left: 60px;">49  cat sam.txt</p>
<p>[This command displays last 10 histories, to display entire history  type only history command (#history)]</p>
<p style="padding-left: 60px;"><strong>#history -c </strong> [Clears all history ]</p>
<p>9. <strong>find</strong> &#8211; search for files in a directory</p>
<p style="padding-left: 60px;"><strong># find  /opt -name “eclipse”</strong></p>
<p>[This command will search the files and folders contains the name 'eclipse'  in /opt directory]</p>
<p>10. <strong>tar </strong>- Cretae Append , Delete , Extract the archive files</p>
<p style="padding-left: 60px;"><strong>#tar -cf my.tar a.txt b.txt </strong>[Create my.tar from files ] a.txt and b.txt.</p>
<p style="padding-left: 60px;"><strong>#tar -tvf my.tar</strong> [List all files in my.tar]</p>
<p style="padding-left: 60px;"><strong>#tar -xf my.tar </strong> [ Extract all files from my.tar]</p>
<p style="padding-left: 60px;"><strong>#tar -xzvf eclipse.tar.gz </strong>[ Extract  tar.gz file]</p>
<p style="padding-left: 60px;"><strong>#tar -xjvf octave.tar.bz2</strong> [Extract  tar.bz2 file]</p>
<h2 style="text-align: center;"><a href="http://openpeta.com/wp-content/uploads/2010/05/10-Basic-Commands-Reference-Card1.pdf" target="_blank"><span style="color: #800080;"><strong>Download the Reference Card </strong></span></a></h2>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2010/05/10-basic-linux-commands/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Copy and Delete Commands [cp and rm]</title>
		<link>http://openpeta.com/index.php/2010/04/copy-and-delete-commands-cp-and-rm/</link>
		<comments>http://openpeta.com/index.php/2010/04/copy-and-delete-commands-cp-and-rm/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 08:24:00 +0000</pubDate>
		<dc:creator>ANTHONIRAJ</dc:creator>
				<category><![CDATA[Basic Commands]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/?p=846</guid>
		<description><![CDATA[1. cp command This command is used for copying folders and files from source to destination. Copying Files # cd /home/anthoniraj/uploads/ # cp kavidhai.pdf /opt/ [copy the file kavithai.pdf into /opt folder] # cp kavidhai.pdf sam.txt /opt/ [copy the files kavithai.pdf and sam.txt into /opt folder ] Copying Folders # cp -r uploads/ /opt/ [Copy [...]]]></description>
			<content:encoded><![CDATA[<h5><strong>1. cp command</strong></h5>
<p>This command is used for copying folders and files from source to destination.</p>
<p><strong>Copying Files</strong></p>
<blockquote><p># cd /home/anthoniraj/uploads/<br />
# cp kavidhai.pdf /opt/ [copy the file kavithai.pdf into /opt folder]<br />
# cp kavidhai.pdf sam.txt /opt/ [copy the files kavithai.pdf and sam.txt into /opt folder ]</p></blockquote>
<p><strong>Copying Folders</strong></p>
<blockquote><p># cp -r uploads/ /opt/ [Copy the folder uploads and its content into /opt folder]</p></blockquote>
<h5><strong>2. rm command &#8211; delete files and folders</strong></h5>
<blockquote><p># cd /opt/uploads<br />
# rm kavidhai.pdf [Delete kavithai.pdf from uploads folder ]<br />
# cd ..<br />
# rm -r uploads/ [Delete the folder uploads/ and its content from /opt]</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2010/04/copy-and-delete-commands-cp-and-rm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Linux Commands : &quot;apropos&quot; and &quot;cd&quot;</title>
		<link>http://openpeta.com/index.php/2010/04/basic-linux-commands-apropos-and-cd/</link>
		<comments>http://openpeta.com/index.php/2010/04/basic-linux-commands-apropos-and-cd/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 02:01:34 +0000</pubDate>
		<dc:creator>ANTHONIRAJ</dc:creator>
				<category><![CDATA[Basic Commands]]></category>
		<category><![CDATA[Linux on NoteBook PCs]]></category>
		<category><![CDATA[Ubuntu Linux]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/?p=757</guid>
		<description><![CDATA[apropos Each manual page has short description available within it, apropos command will search the command short description with the given keyword. This command is same as man -k option. but the advantage of apropos is using regular expression for searching the commands. Example #apropos &#8220;print&#8221; #apropos -r &#8220;^[p]+[g]$&#8221; pg (1)               &#8211; browse pagewise through [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><strong>apropos</strong><br />
Each manual page has short description available within it, apropos command will search the command short description with the given keyword. This command is same as man -k option. but the advantage of apropos is using regular expression for searching the commands.<br />
Example</p>
<blockquote>
<h4 style="text-align: justify;"><strong>#apropos &#8220;print&#8221;</strong></h4>
</blockquote>
<p style="text-align: justify;">
<div id="attachment_758" class="wp-caption aligncenter" style="width: 310px"><a href="http://openpeta.com/wp-content/uploads/2010/04/Print11.png"><img class="size-medium wp-image-758" title="Print1" src="http://www.openpeta.com/wp-content/uploads/2010/04/Print1-300x170.png" alt="apropos Sample Output Page" width="300" height="170" /></a><p class="wp-caption-text">apropos Sample Output Page</p></div>
<blockquote>
<h4><strong> #apropos -r &#8220;^[p]+[g]$&#8221;</strong></h4>
<h4>pg (1)               &#8211; browse pagewise through text files</h4>
</blockquote>
<p style="text-align: justify;">This pattern will match the command description word starting with &#8220;p&#8221; and ends with &#8220;g&#8221;. Like this user can create your own pattern for finding commands.</p>
<p><strong>cd  &#8211; Change Directory</strong><br />
cd command is used for changing the current directoy to some destination directory which you want to use. First you need to find which directory currently you are using, for that you can use &#8220;pwd &#8211; present working directory&#8221; command.<br />
<strong>Examples</strong></p>
<blockquote>
<h4><strong>anthoniraj@Ubuntu:~$ pwd</strong></h4>
<h4><strong>/home/anthoniraj</strong></h4>
</blockquote>
<p>I am using home directory , here anthoniraj is the user of the system. Now i want to change home directory to &#8220;/opt&#8221;</p>
<blockquote>
<h4 style="text-align: justify;"><strong>anthoniraj@Ubuntu:~$ cd /opt/</strong></h4>
<h4 style="text-align: justify;"><strong>anthoniraj@Ubuntu:/opt$</strong></h4>
</blockquote>
<p style="text-align: justify;">You can also use dot (.) for changing directory</p>
<blockquote>
<h4><strong>anthoniraj@Ubuntu:/opt$ cd ..</strong></h4>
<h4><strong>anthoniraj@Ubuntu:/$ pwd</strong></h4>
<h4><strong>/</strong></h4>
<h4><strong>[/ - root directory]</strong></h4>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2010/04/basic-linux-commands-apropos-and-cd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Useful Basic Linux Commands</title>
		<link>http://openpeta.com/index.php/2010/04/10-useful-basic-linux-commands/</link>
		<comments>http://openpeta.com/index.php/2010/04/10-useful-basic-linux-commands/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 07:00:48 +0000</pubDate>
		<dc:creator>ANTHONIRAJ</dc:creator>
				<category><![CDATA[Basic Commands]]></category>
		<category><![CDATA[Linux on NoteBook PCs]]></category>
		<category><![CDATA[Ubuntu Linux]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/?p=737</guid>
		<description><![CDATA[&#8220;Linux: the operating system with a CLUE&#8230; Command Line User Environment&#8221;.﻿ Now a days , everything you can do with GUI mode, even though graphical mode is user friendly , only user can do their work more faster way using commands. As a Linux beginners , you need to know at least some basic commands [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;Linux: the operating system with a CLUE&#8230; Command Line User Environment&#8221;.﻿</p></blockquote>
<p>Now a days , everything you can do with GUI mode, even though graphical mode is user friendly , only user can do their work more faster way using commands. As a Linux beginners , you need to know at least some basic commands which would be useful for your frequent activities in Linux. Here i have given 10 basic commands for beginners to work with some basic regular tasks in Linux .</p>
<ol>
<li>man</li>
<li>apropos</li>
<li>cd</li>
<li>ls</li>
<li>cp</li>
<li>rm</li>
<li>cat</li>
<li>history</li>
<li>find</li>
<li>tar</li>
</ol>
<p>Every command has lot of options , but i am going to give only the basic options for user regular activities. Please refer coming articles for understanding these 10 commands.</p>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2010/04/10-useful-basic-linux-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Run Level Commands</title>
		<link>http://openpeta.com/index.php/2008/02/run-level-commands/</link>
		<comments>http://openpeta.com/index.php/2008/02/run-level-commands/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 06:12:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Basic Commands]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/2008/02/07/run-level-commands/</guid>
		<description><![CDATA[1. Shutdown o init 0 o shutdown -h now + -a: Use file /etc/shutdown.allow + -c: Cancel scheduled shutdown. o halt -p + -p: Turn power off after shutdown. o poweroff 2.Reboot o init 6 o shutdown -r now o reboot 3.Enter single user mode: o init 1]]></description>
			<content:encoded><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml"><b>1. </b><b>Shutdown</b><br />       o<i> init 0</i><br />       o <i>shutdown -h now                </i><br />             + -a: Use file /etc/shutdown.allow               <br />             + -c: Cancel scheduled shutdown.         <br />       o <i>halt -p                </i><br />             + -p: Turn power off after shutdown.<br />       o <i>poweroff    <big></p>
<p></big></i><b>2.Reboot</b><br />       o<i> init 6</i><br />       o <i>shutdown -r now          </i><br />       o <i>reboot   </p>
<p></i><b>3.Enter single user mode:          </b><br />       o <i>init 1</i></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2008/02/run-level-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#039;tail&#039; command</title>
		<link>http://openpeta.com/index.php/2007/10/tail-command/</link>
		<comments>http://openpeta.com/index.php/2007/10/tail-command/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:21:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basic Commands]]></category>
		<category><![CDATA[File Management]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/2007/10/12/tail-command/</guid>
		<description><![CDATA[&#8220;tail&#8221; command &#8211; used to Print the last few lines of each FILE to standard output. Syntax : tail [options] filename [Source from Wikipedia]By default, tail will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;tail&#8221; command &#8211; used to Print  the  last few lines of each FILE to standard output.</p>
<p>Syntax :<br /><span style="font-weight: bold; font-style: italic;"> tail [options] filename</span></p>
<p>[Source from Wikipedia]<br />By default, tail will print the last 10 lines of its input to the standard output. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename:<br /><span style="font-weight: bold; font-style: italic;">tail -n 20 filename</span></p>
<p>This example shows the last 15 bytes of all files starting with filename :<br /><span style="font-weight: bold; font-style: italic;">tail -c 15 filename</span></p>
<p>This example shows all lines of filename from the second line onwards:<br /><span style="font-weight: bold; font-style: italic;">tail -n +2 filename</span></p>
<p>Using an older syntax (still used in Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:<br /><span style="font-weight: bold; font-style: italic;">tail -20 filename</span><br /><span style="font-weight: bold; font-style: italic;">tail -50c filename</span></p>
<p>However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.</p>
<p><span style="font-weight: bold; font-style: italic;">File monitoring</span></p>
<p>tail has a special command line option -f (follow) that allows a file to be monitored. Instead of displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:</p>
<p><span style="font-weight: bold; font-style: italic;">tail -f /var/adm/messages</span></p>
<p>To interrupt tail while it is monitoring, break-in with CTRL-C. This command can be run &#8220;in the background&#8221; with &amp;, see job control.</p>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2007/10/tail-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File and Directory Commands</title>
		<link>http://openpeta.com/index.php/2007/10/file-and-directory-commands/</link>
		<comments>http://openpeta.com/index.php/2007/10/file-and-directory-commands/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 06:43:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basic Commands]]></category>
		<category><![CDATA[File Management]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/2007/10/10/file-and-directory-commands/</guid>
		<description><![CDATA[1.mkdir &#8211;make directories or folder# mkdir [dirname]&#8211;> creates specified directory 2.cd &#8211; change directory path# cd [dirname]&#8211;> switches into specified directory# cd .. &#8211;>moves one directory up# cd ../../ &#8212;> moves two directories up (and so on)# cd &#8211;> brings you to highest level of your home directory 3.rm &#8211; delete files and directories# rmdir [...]]]></description>
			<content:encoded><![CDATA[<p>1.mkdir &#8211;make directories or folder<br /># <strong><em>mkdir [dirname]</em></strong>&#8211;> creates specified directory</p>
<p>2.cd &#8211; change directory path<br /># <strong><em>cd [dirname]<dirname></em></strong>&#8211;> switches into specified directory<br /># cd .. &#8211;>moves one directory up<br /># cd ../../ &#8212;> moves two directories up (and so on)<br /># cd &#8211;> brings you to highest level of your home directory</p>
<p>3.rm &#8211; delete files and directories<br /># rmdir &#8211;> removes empty directory<br /># rm &#8211;> removes file name<br /># <strong><em>rm -r</em></strong> &#8211;> removes directory including its content, but asks for confirmation, &#8216;f&#8217; argument turns confirmation off</p>
<p>4.mv &#8211; move or rename the file or directory<br /># <strong><em>mv [name1] [name2]</em></strong> <name1><name2>&#8211;> renames directories or files<br /># mv [name] [dir]&#8211;> moves file/directory as specified in path<br /># <strong><em>rename [oldfilename] [newfilename] [oldfilename]<newfilename>
<oldfilename><newfilename><br /></em></strong><br />5.cp -copy files and directory<br /># <strong><em>cp [file] [path]</em></strong> <file>
<path>&#8211;> copy file/directory as specified in path (-r to include content in directories)</p>
<p>6. <strong><em>pwd</em></strong> &#8211;> present working directory<br />7. <strong><em>ls </em></strong>&#8211;> content of pwd<br />8. ll &#8211;> similar as ls, but provides additional info on files and directories<br />9. ll -a &#8211;> includes hidden files (.name) as well<br />10. <strong><em>ll -R</em></strong> &#8211;> lists subdirectories recursively<br />11 ll -t &#8211;> lists files in chronological order<br />12.<strong><em>dir</em></strong> &#8211; display the directory contents<br />13.<strong><em>stat [filename]<filename>&#8211;></em></strong> provides all attributes of a file</p>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2007/10/file-and-directory-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Head Command</title>
		<link>http://openpeta.com/index.php/2007/10/head-command/</link>
		<comments>http://openpeta.com/index.php/2007/10/head-command/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 04:54:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basic Commands]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/2007/10/09/head-command/</guid>
		<description><![CDATA[&#8220;head&#8221; command &#8211; used to Print the first 10 lines of each FILE to standard output. Syntax : head options filename Examples1) Sample file root@VIT#vi sample.c//Write a program to display the name and address of the computer that we are currently//working on. #include #include #include #include #include int main(int argc,char *argv[]){struct hostent *he; // note [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;head&#8221; command &#8211; used to Print  the  first 10 lines of each FILE to standard output.</p>
<p>Syntax :<br /> head options filename</p>
<p>Examples<br />1) Sample file</p>
<p>root@VIT#vi sample.c<br />//Write a program to display the name and address of the computer that we are currently<br />//working on.</p>
<p>#include <stdio.h><br />#include <sys h=""><br />#include <netinet h=""><br />#include <netdb.h><br />#include <sys h=""><br />int main(int argc,char *argv[])<br />{<br />struct hostent *he;               // note the spelling it is hostent<br />printf(&#8220;%d &#8220;,argc);<br />printf(&#8220;%s &#8220;,argv[0]);<br />printf(&#8220;%s \n&#8221;,argv[1]);<br />if (argc!=2)<br />       {<br />       printf(&#8220;Error in input&#8221;);<br />       exit(-1);<br />       }<br />he=gethostbyname(argv[1]);<br />if (he == NULL)<br />       {<br />       printf(&#8220;Get host by name error&#8221;);<br />       }<br />printf(&#8220;Name == >> %s \n&#8221;,he->h_name);<br />printf(&#8220;Address == >> %s \n&#8221;,inet_ntoa(*((struct in_addr *)he->h_addr)));<br />return 0;<br />}</p>
<p>2) Noraml head command display the first 10 lines from the file<br />root@VITX#head sample.c<br />//write a program to display the name and address of the computer that we are currently<br />//working on.</p>
<p>#include <stdio.h><br />#include <sys h=""><br />#include <netinet h=""><br />#include <netdb.h><br />#include <sys h=""><br />int main(int argc,char *argv[])<br />{</p>
<p>3) Option -c  print the first N bytes of each file</p>
<p>root@VIT#head -c 100 sample.c<br />//Write a program to display the name and address of the computer that we are currently<br />root@VITLINUX#head -c 500 sample.c500 sample.c<br />//Write a program to display the name and address of the computer that we are currently<br />//working on.</p>
<p>#include <stdio.h><br />#include <sys h=""><br />#include <netinet h=""><br />#include <netdb.h><br />#include <sys h=""><br />int main(int argc,char *argv[])<br />{<br />struct hostent *he;               // note the spelling it is hostent<br />printf(&#8220;%d &#8220;,argc);<br />printf(&#8220;%s &#8220;,argv[0]);<br />printf(&#8220;%s \n&#8221;,argv[1]);<br />if (argc!=2)<br />       {<br />       printf(&#8220;Error in input&#8221;);<br />       exit(-1);<br />       }<br />he=gethostbyname(argv[1]);<br />if (he == NULL)<br />       {<br />       printf(&#8220;Get</p>
<p>4) Option -n print the first N lines instead of the first 10</p>
<p>root@VIT#head -n  5 sample.c<br />//Write a program to display the name and address of the computer that we are currently<br />//working on.</p>
<p>#include <stdio.h><br />#include <sys h=""><br />root@VITLINUX#head -n  6 sample.c<br />//Write a program to display the name and address of the computer that we are currently<br />//working on.</p>
<p>#include <stdio.h><br />#include <sys h=""><br />#include <netinet h=""></netinet></sys></stdio.h></sys></stdio.h></sys></netdb.h></netinet></sys></stdio.h></sys></netdb.h></netinet></sys></stdio.h></sys></netdb.h></netinet></sys></stdio.h></p>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2007/10/head-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rename and Move (mv) commands</title>
		<link>http://openpeta.com/index.php/2007/09/rename-and-move-mv-commands/</link>
		<comments>http://openpeta.com/index.php/2007/09/rename-and-move-mv-commands/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 06:59:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basic Commands]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/2007/09/26/rename-and-move-mv-commands/</guid>
		<description><![CDATA[mv command is used for moving file from one place to other Syntax mv [OPTION]&#8230; SOURCE&#8230; DIRECTORY Example1. [root@myclient1 ~]# mv sample.c /home/ameer/rename command is used for rename the given file and also we can use mv command for rename the file Syntax rename from to file&#8230; mv SOURCE DEST Examples1. [root@myclient1 ~]# rename abc.pl [...]]]></description>
			<content:encoded><![CDATA[<p>mv command is used for moving file from one place to other</p>
<p>Syntax</p>
<p> mv [OPTION]&#8230; SOURCE&#8230; DIRECTORY</p>
<p>Example<br />1.  <span style="font-style: italic;">[root@myclient1 ~]# mv sample.c /home/ameer/<br /></span><br />rename command is used for  rename the given file and also we can use mv command for rename the file</p>
<p>Syntax<br />    rename from to file&#8230;<br />    mv  SOURCE DEST</p>
<p>Examples<br />1. <span style="font-style: italic;">[root@myclient1 ~]# rename abc.pl new.c abc.pl</span><br />[root@myclient1 ~]# ls<br />3318.PDF         a.sh         file1             new.c</p>
<p>2. <span style="font-style: italic;">[root@myclient1 ~]# mv new.c new1.c</span><br />[root@myclient1 ~]# ls<br />3318.PDF         a.sh         file1             new1.c<span style="font-style: italic;"><br /></span></p>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2007/09/rename-and-move-mv-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copying Files and directories &#8211; &#039;cp&#039; Command</title>
		<link>http://openpeta.com/index.php/2007/09/copying-files-and-directories-cp-command/</link>
		<comments>http://openpeta.com/index.php/2007/09/copying-files-and-directories-cp-command/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 05:33:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Basic Commands]]></category>

		<guid isPermaLink="false">http://www.openpeta.com/2007/09/26/copying-files-and-directories-cp-command/</guid>
		<description><![CDATA[cp command is used to copy the files and directories from one place to other. Syntax cp options source destination Examples : 1. For copying one file from one location to other [root@MB327SCS068 antony]# cp sample.c /home/admin/ Now the sample.c (Which is in /home/antony) has been copied into /home/admin 2. For copying more than one [...]]]></description>
			<content:encoded><![CDATA[<p>cp command is used to copy the files and directories from one place to other.</p>
<p>Syntax<br /><span style="font-style: italic; font-weight: bold;">  cp options source destination</p>
<p></span>Examples :<br /> 1.  For copying one file from one location to other</p>
<p><span style="font-style: italic;"></span>  <span style="font-style: italic;">   [root@MB327SCS068 antony]# cp sample.c /home/admin/</p>
<p></span>     Now the sample.c (Which is in /home/antony) has been copied into /home/admin</p>
<p>2. For copying more than one file  from one location to other</p>
<p>   <span style="font-style: italic;">[root@MB327SCS068 antony]# cp sample.c sample2.c /home/admin/</span></p>
<p>    Now the sample.c  and sample2. (Which is in /home/antony) have been copied into  /home/admin</p>
<p>3. To copy whole directory to other location<br /><span style="font-style: italic;">  </span><br /><span style="font-style: italic;"> [root@MB327SCS068 antony]# cp -R /home/antony/  /mnt/</p>
<p></span>  Now the /home/antony / directory and  (-R => recursively)  sub directory   have been copied into  /mnt</p>
<p><span style="font-style: italic;"><br /></span><br /><span style="font-style: italic;"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://openpeta.com/index.php/2007/09/copying-files-and-directories-cp-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
