<?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>Suse &#38; OpenSuse Tips &#187; command</title>
	<atom:link href="http://www.susetips.com/tag/command/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.susetips.com</link>
	<description>Tricks, Guides, Tutorials, How Tos and Troubleshooting suse linux</description>
	<lastBuildDate>Sat, 05 Jun 2010 17:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Automatically dating your tar backups</title>
		<link>http://www.susetips.com/2009/05/05/automatically-dating-your-tar-backups/</link>
		<comments>http://www.susetips.com/2009/05/05/automatically-dating-your-tar-backups/#comments</comments>
		<pubDate>Wed, 06 May 2009 05:38:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[compression]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/05/05/automatically-dating-your-tar-backups/</guid>
		<description><![CDATA[Normally, we use the tar command coupled with some compression program such as gzip to create a backup of our directories. I.e. # tar -cf /var/log/backup/tux.tar /home/tux to backup the home directory of the user tux into the directory&#160; /var/log/backup. However, if we are going to do this on a regular basis, we will be [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/05/05/automatically-dating-your-tar-backups/">Automatically dating your tar backups</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Normally, we use the <font face="Courier New">tar</font> command coupled with some compression program such as <font face="Courier New">gzip</font> to create a backup of our directories. I.e.</p>
<blockquote><p># tar -cf /var/log/backup/tux.tar /home/tux</p>
</blockquote>
<p>to backup the home directory of the user <font face="Courier New">tux</font> into the directory&#160; <font face="Courier New">/var/log/backup</font>. </p>
<p> <span id="more-159"></span>
<p>However, if we are going to do this on a regular basis, we will be overwriting the file <font face="Courier New">tux.tar</font>.&#160; This would mean that we will only have one snapshot of the user <font face="Courier New">tux</font> home directory.</p>
<p>To keep copies of backups from different times, you will need to use different filenames, preferably with a date indicator.&#160; You can easily do this by,</p>
<blockquote><p><font face="Courier New"># tar –cf /var/log/backup/tux-<strong>`date +%F`</strong>.tar /home/tux</font></p>
</blockquote>
<p>Of course, if you backup a few times within the day, then you may want to use a different option from the <font face="Courier New"><strong>+%F</strong></font> format option.</p>
<p> <script type="text/javascript"><!--
google_ad_client = "pub-4709064562032853";
/* 300x250, created 5/8/09 */
google_ad_slot = "9311445083";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/05/05/automatically-dating-your-tar-backups/">Automatically dating your tar backups</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/05/29/differential-backup-script-sample/" rel="bookmark" title="Permanent Link: Differential backup script sample">Differential backup script sample</a></li><li><a href="http://www.susetips.com/2010/01/12/how-to-install-gnomekde-desktop-environment-on-opensuse-11/" rel="bookmark" title="Permanent Link: How to install Gnome/KDE Desktop Environment on OpenSuse 11">How to install Gnome/KDE Desktop Environment on OpenSuse 11</a></li><li><a href="http://www.susetips.com/2009/06/29/how-to-start-services-automatically-at-boot/" rel="bookmark" title="Permanent Link: How to start services automatically at boot?">How to start services automatically at boot?</a></li><li><a href="http://www.susetips.com/2009/04/22/how-to-mount-nfs-filesystems-at-boot-time/" rel="bookmark" title="Permanent Link: How to mount NFS Filesystems at Boot Time">How to mount NFS Filesystems at Boot Time</a></li><li><a href="http://www.susetips.com/2009/04/27/how-to-create-shortcuts-on-gnome-desktop/" rel="bookmark" title="Permanent Link: How to create shortcuts on Gnome desktop">How to create shortcuts on Gnome desktop</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/05/05/automatically-dating-your-tar-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short and quick tutorial for the command “touch”</title>
		<link>http://www.susetips.com/2009/05/05/short-and-quick-tutorial-for-the-command-touch/</link>
		<comments>http://www.susetips.com/2009/05/05/short-and-quick-tutorial-for-the-command-touch/#comments</comments>
		<pubDate>Wed, 06 May 2009 05:19:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[desktop]]></category>
		<category><![CDATA[command]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/05/05/short-and-quick-tutorial-for-the-command-touch/</guid>
		<description><![CDATA[The touch command is typically used for 2 purposes, to create a new file and to modify the access and modification times of the file.&#160; If the file already exist, it will update the&#160; both the access and modification times of the file and if it does not exist, it will create a new file.&#160; [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/05/05/short-and-quick-tutorial-for-the-command-touch/">Short and quick tutorial for the command “touch”</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The <font face="Courier New">touch</font> command is typically used for 2 purposes, to create a new file and to modify the access and modification times of the file.&#160; If the file already exist, it will update the&#160; both the access and modification times of the file and if it does not exist, it will create a new file.&#160; The latter is probably the most common usage of the command.</p>
<p><img title="touch" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="85" alt="touch" src="http://www.susetips.com/wp-content/uploads/2009/05/touch.jpg" width="320" border="0" /> </p>
<p> <span id="more-157"></span>
<p>For example, to update the access and modification time stamp on a file to the current time;</p>
<blockquote><p><font face="Courier New"># touch helloworld.c</font></p>
</blockquote>
<p>You can also use a specific time by using the <font face="Courier New"><strong>–t</strong></font> option or just modify either the access or modification time only, using the <font face="Courier New"><strong>–a</strong></font> and <font face="Courier New"><strong>–m</strong></font> options respectively.</p>
<p> <script type="text/javascript"><!--
google_ad_client = "pub-4709064562032853";
/* 300x250, created 5/8/09 */
google_ad_slot = "9311445083";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/05/05/short-and-quick-tutorial-for-the-command-touch/">Short and quick tutorial for the command “touch”</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “find”">Short and quick tutorial for the command “find”</a></li><li><a href="http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “tar”">Short and quick tutorial for the command “tar”</a></li><li><a href="http://www.susetips.com/2009/05/29/differential-backup-script-sample/" rel="bookmark" title="Permanent Link: Differential backup script sample">Differential backup script sample</a></li><li><a href="http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/" rel="bookmark" title="Permanent Link: Using the “date” command and it’s % options">Using the “date” command and it’s % options</a></li><li><a href="http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/" rel="bookmark" title="Permanent Link: Using command output with backquotes">Using command output with backquotes</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/05/05/short-and-quick-tutorial-for-the-command-touch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using command output with backquotes</title>
		<link>http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/</link>
		<comments>http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/#comments</comments>
		<pubDate>Wed, 06 May 2009 03:43:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[desktop]]></category>
		<category><![CDATA[command]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/</guid>
		<description><![CDATA[The backquote (`), which is quite alien to most Windows users, is the key just below the top left hand side ESC key on your keyboard.  This is a useful key to use when you want to use the standard output of a UNIX/LINUX command as part of another command. For example, if you want [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/">Using command output with backquotes</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The backquote (`), which is quite alien to most Windows users, is the key just below the top left hand side ESC key on your keyboard.  This is a useful key to use when you want to use the standard output of a UNIX/LINUX command as part of another command.</p>
<p><img style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" title="DSC00380-1" src="http://www.susetips.com/wp-content/uploads/2009/05/dsc003801.jpg" border="0" alt="DSC00380-1" width="320" height="497" /></p>
<p><span id="more-154"></span></p>
<p>For example, if you want to output the results of an addition.</p>
<blockquote><p><span style="font-family: Courier New;"># expr 10 + 42<br />
# 52</span></p></blockquote>
<p>If you would like to make it fancier,</p>
<blockquote><p><span style="font-family: Courier New;"># echo “The sum is <span style="color: #ff0000;">`</span>expr 10 + 42<span style="color: #ff0000;">`</span>”<br />
The sum is 52</span></p></blockquote>
<p>Note the backquotes (in <span style="color: #ff0000;">red</span>).</p>
<p><!--adsense#1--></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/">Using command output with backquotes</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/" rel="bookmark" title="Permanent Link: Using the “date” command and it’s % options">Using the “date” command and it’s % options</a></li><li><a href="http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/" rel="bookmark" title="Permanent Link: Using redirections: 2>&#038;1 (Part 2 of 2)">Using redirections: 2>&#038;1 (Part 2 of 2)</a></li><li><a href="http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “tar”">Short and quick tutorial for the command “tar”</a></li><li><a href="http://www.susetips.com/2009/04/19/using-redirections-part-1-of-2/" rel="bookmark" title="Permanent Link: Using redirections; <, >, >> (Part 1 of 2)">Using redirections; <, >, >> (Part 1 of 2)</a></li><li><a href="http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “find”">Short and quick tutorial for the command “find”</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using redirections: 2&gt;&amp;1 (Part 2 of 2)</title>
		<link>http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/</link>
		<comments>http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 05:21:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[command]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/</guid>
		<description><![CDATA[If you go through enough shell scripts, you will notice the frequent use of 2&#62;&#38;1.&#160; What does it mean and how it works? We have briefly introduced standard in (stdin) and standard out (stdout).&#160; In the command line interface and also in shell programming, these are represented as follows: 0 Standard In (STDIN) 1 Standard [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/">Using redirections: 2>&#038;1 (Part 2 of 2)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If you go through enough shell scripts, you will notice the frequent use of 2&gt;&amp;1.&#160; What does it mean and how it works?</p>
<p>We have briefly introduced standard in (stdin) and standard out (stdout).&#160; In the command line interface and also in shell programming, these are represented as follows:</p>
<ul>
<li>0 Standard In (STDIN) </li>
<li>1 Standard Out (STDOUT) </li>
<li>2 Standard Error (STDERR) </li>
</ul>
<p> <span id="more-139"></span>
<p>The <font face="Courier New">2&gt;&amp;1</font> basically means that to redirect standard error (STDERR) to standard out (STDOUT).&#160; We use <font face="Courier New">tar</font> to archive the home directory of the user <font face="Courier New">susetips</font> and redirect the verbose output to a file <font face="Courier New">bak.log</font> as an example;</p>
<blockquote><p><font face="Courier New"># tar cvf susetips.bak /home/susetips &gt;&gt; bak.log        <br />tar: Removing leading ‘/’ from member names</font></p>
</blockquote>
<p>The command above basically kept a listing of the files that were backed up in the file <font face="Courier New">bak.log</font>.&#160; This file can be kept as a reference to know what files were actually backed up.&#160; However, there’s a message from the <font face="Courier New">tar</font> command that still appeared on the terminal.&#160; This message is a warning/error message that outputs to STDERR, which in this case is the terminal.&#160; The <font face="Courier New">&gt;&gt;</font> redirection just puts the STDOUT to the file but not the STDERR.&#160; To redirect the STDERR to the same place as the STDOUT;</p>
<blockquote><p><font face="Courier New"># tar cvf susetips.bak /home/susetips &gt;&gt; bak.log 2&gt;&amp;1        <br />#</font></p>
</blockquote>
<p>Where the <font face="Courier New">2</font> represented STDERR, <font face="Courier New">&gt;</font> means redirect to and <font face="Courier New">&amp;1</font> is the variable name for STDOUT.&#160; You can check the content of the file <font face="Courier New">bak.log</font> by using the <font face="Courier New">cat </font>command. </p>
<p> <!--adsense#1--></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/">Using redirections: 2>&#038;1 (Part 2 of 2)</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/04/19/using-redirections-part-1-of-2/" rel="bookmark" title="Permanent Link: Using redirections; <, >, >> (Part 1 of 2)">Using redirections; <, >, >> (Part 1 of 2)</a></li><li><a href="http://www.susetips.com/about/" rel="bookmark" title="Permanent Link: About Us">About Us</a></li><li><a href="http://www.susetips.com/2009/04/27/how-to-create-shortcuts-on-gnome-desktop/" rel="bookmark" title="Permanent Link: How to create shortcuts on Gnome desktop">How to create shortcuts on Gnome desktop</a></li><li><a href="http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/" rel="bookmark" title="Permanent Link: Using command output with backquotes">Using command output with backquotes</a></li><li><a href="http://www.susetips.com/2009/04/15/what-are-z-gz-and-bz2-files/" rel="bookmark" title="Permanent Link: What are .Z, .gz and .bz2 files?">What are .Z, .gz and .bz2 files?</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using redirections; , &gt;&gt; (Part 1 of 2)</title>
		<link>http://www.susetips.com/2009/04/19/using-redirections-part-1-of-2/</link>
		<comments>http://www.susetips.com/2009/04/19/using-redirections-part-1-of-2/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 04:51:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[command]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/04/19/using-redirections-part-1-of-2/</guid>
		<description><![CDATA[Redirections can be sometimes confusing to learn and utilize effectively.&#160; We will try to explain it in the simplest possible way that we think is effective.&#160; Please feel free to suggests a better approach to explaining it. Firstly, the 3 basic redirections. &#60; ; this less than symbol is to instruct the shell to read [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/19/using-redirections-part-1-of-2/">Using redirections; <, >, >> (Part 1 of 2)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Redirections can be sometimes confusing to learn and utilize effectively.&#160; We will try to explain it in the simplest possible way that we think is effective.&#160; Please feel free to suggests a better approach to explaining it.</p>
<p>Firstly, the 3 basic redirections.</p>
<ul>
<li><strong>&lt;</strong> ; this less than symbol is to instruct the shell to read from a file instead of the standard input (stdin) which is generally the keyboard. As an example, assuming that you have a file <font face="Courier New">2compute </font>and using the command <font face="Courier New">bc</font> (basic calculator), you can redirect the content of <font face="Courier New">2compute</font> for <font face="Courier New">bc</font>. </li>
</ul>
<blockquote><p><font face="Courier New"># cat 2compute        <br />1 + 1         <br />2 / 2         <br /># bc &lt; 2compute         <br />2         <br />1         <br />#</font></p>
</blockquote>
<p> <span id="more-138"></span>
<ul>
<li><strong>&gt;</strong> ; the greater than symbol is to redirect the standard out (stdout) to a file instead of the screen/monitor (depending on what stdout is defined as). As an example, the <font face="Courier New">ls</font> command which list the content of your directory will display it on your terminal.&#160; We can redirect the output into a file (we use mydirectory as an example) </li>
</ul>
<blockquote><p><font face="Courier New"># ls        <br />bin&#160; Desktop&#160; Distribution&#160; Documents&#160; susetips         <br /># ls &gt; mydirectory         <br /># cat mydirectory         <br />bin         <br />Desktop         <br />Distribution         <br />Documents         <br />mydirectory         <br />susetips</font></p>
</blockquote>
<ul>
<li><strong>&gt;&gt;</strong> ; similarly to the &gt; symbol, using double greater than will append to the specified file as oppose to overwriting the file (if it exists).&#160; Following our previous example, if you use the single &gt;, it will overwrite the old file.&#160; Using the double &gt;, it will append to it. </li>
</ul>
<blockquote><p># cat mydirectory      <br />bin       <br />Desktop       <br />Distribution       <br />Documents       <br />mydirectory       <br />susetips       <br /># ls &gt; mydirectory       <br /># cat mydirectory       <br />bin       <br />Desktop       <br />Distribution       <br />Documents       <br />mydirectory       <br />susetips       <br />#ls &gt;&gt; mydirectory       <br /># cat mydirectory       <br />bin       <br />Desktop       <br />Distribution       <br />Documents       <br />mydirectory       <br />susetips       <br />bin       <br />Desktop       <br />Distribution       <br />Documents       <br />mydirectory       <br />susetips       <br />#</p>
</blockquote>
<p>Next, the puzzling <font face="Courier New"><strong>2&gt;&amp;1</strong></font></p>
<p> <!--adsense#1--></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/19/using-redirections-part-1-of-2/">Using redirections; <, >, >> (Part 1 of 2)</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/" rel="bookmark" title="Permanent Link: Using redirections: 2>&#038;1 (Part 2 of 2)">Using redirections: 2>&#038;1 (Part 2 of 2)</a></li><li><a href="http://www.susetips.com/about/" rel="bookmark" title="Permanent Link: About Us">About Us</a></li><li><a href="http://www.susetips.com/2009/04/27/how-to-create-shortcuts-on-gnome-desktop/" rel="bookmark" title="Permanent Link: How to create shortcuts on Gnome desktop">How to create shortcuts on Gnome desktop</a></li><li><a href="http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/" rel="bookmark" title="Permanent Link: Using command output with backquotes">Using command output with backquotes</a></li><li><a href="http://www.susetips.com/2009/04/15/what-are-z-gz-and-bz2-files/" rel="bookmark" title="Permanent Link: What are .Z, .gz and .bz2 files?">What are .Z, .gz and .bz2 files?</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/04/19/using-redirections-part-1-of-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the “date” command and it’s % options</title>
		<link>http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/</link>
		<comments>http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 07:03:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[command]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/</guid>
		<description><![CDATA[Well, you can’t really get a date with this command but it is a very useful command to know for administrative tasks as well as for automatic documentation through scripting. However, the date command’s options often baffles a lot of people (well, in my administering SuSE Linux class anyway) especially when they read about the [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/">Using the “date” command and it’s % options</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Well, you can’t really get a <strong>date</strong> with this command but it is a very useful command to know for administrative tasks as well as for automatic documentation through scripting.</p>
<p>However, the <font face="Courier New">date</font> command’s options often baffles a lot of people (well, in my administering SuSE Linux class anyway) especially when they read about the formatting using the % symbol on the man pages.</p>
<p> <span id="more-132"></span>
<p>Let me briefly extract what the man pages say;</p>
<blockquote><p><font face="Courier New">NAME        <br />&#160;&#160;&#160; date – print or set the system date and time         </p>
<p>SYNOPSIS         <br />&#160;&#160;&#160; date [OPTION] … [+FORMAT]         <br />&#160;&#160;&#160; date [-u|—utc|—universal] [MMDDhhmm[[CC]YY][.ss]]         </p>
<p>DESCRIPTION         <br />&#160;&#160;&#160; … blah blah …         </p>
<p>&#160;&#160;&#160; FORMAT controls the output. The only valid option         <br />&#160;&#160;&#160; for the second form specifies Coordinated         <br />&#160;&#160;&#160; Universal Time.&#160; Interpreted sequences are:         </p>
<p>&#160;&#160;&#160; %%&#160;&#160;&#160; a literal %         <br />&#160;&#160;&#160; …         <br />&#160;&#160;&#160; %F&#160;&#160;&#160; full date; same as %Y-%m-%d</font></p>
</blockquote>
<p>I have seen many different attempts at trying to understand how to use the %F, e.g.</p>
<blockquote><p><font face="Courier New"># date %F</font></p>
</blockquote>
<p>or</p>
<blockquote><p><font face="Courier New"># date –F</font></p>
</blockquote>
<p>However, it is actually quite clear but somehow it is not the usual UNIX/LINUX command option format.&#160; To get the date in the format 2009-04-17 (today’s date), you simply do</p>
<blockquote><p><font face="Courier New"># date +%F        <br />2009-04-17</font></p>
</blockquote>
<p>It becomes obvious after you read the man page again.</p>
<p> <!--adsense#1--></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/">Using the “date” command and it’s % options</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/05/29/differential-backup-script-sample/" rel="bookmark" title="Permanent Link: Differential backup script sample">Differential backup script sample</a></li><li><a href="http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “tar”">Short and quick tutorial for the command “tar”</a></li><li><a href="http://www.susetips.com/2009/05/05/automatically-dating-your-tar-backups/" rel="bookmark" title="Permanent Link: Automatically dating your tar backups">Automatically dating your tar backups</a></li><li><a href="http://www.susetips.com/2009/05/05/short-and-quick-tutorial-for-the-command-touch/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “touch”">Short and quick tutorial for the command “touch”</a></li><li><a href="http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “find”">Short and quick tutorial for the command “find”</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short and quick tutorial for the command “tar”</title>
		<link>http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/</link>
		<comments>http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 10:00:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[utility]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[compression]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/</guid>
		<description><![CDATA[We have recently posted about tarball and the use of tar coupled with compression programs to create it.&#160; Here, we will go through three (3) short tutorial on using tar. To compress a list of files To compress (the c in the options) a list of files into a specific file (the f in the [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/">Short and quick tutorial for the command “tar”</a></p>
]]></description>
			<content:encoded><![CDATA[<p>We have recently posted about tarball and the use of <font face="Courier New">tar</font> coupled with compression programs to create it.&#160; Here, we will go through three (3) short tutorial on using <font face="Courier New">tar</font>.</p>
<h3>To compress a list of files</h3>
<p>To compress (the <strong>c</strong> in the options) a list of files into a specific file (the <strong>f</strong> in the options) whilst having the tar program to provide progress of it (verbose mode, the <strong>v</strong> in the option), we use</p>
<p> <span id="more-131"></span><br />
<blockquote>
<p><font face="Courier New"># tar cvf &lt;tarfile&gt;.tar &lt;list of files&gt;</font></p>
</blockquote>
<p>Leading / will be removed from the archived listing as this will prevent accidental replacement of system files if the file is uncompressed by root.</p>
<h3>To uncompress a file</h3>
<p>Similarly, we use the same command options where we replace the <strong>c</strong> with <strong>x</strong> (for e<strong>X</strong>tract).</p>
<blockquote><p><font face="Courier New"># tar xvf tarfile.tar</font></p>
</blockquote>
<p>This will extract all the files from the archive and recreate the directories and files in the location where the user is in.&#160; Note that, it is good practice to create a new directory, change directory into it before you extract from a tar archive.&#160; This is to prevent overwriting of existing files, unless that is the intention.</p>
<h3>To view content of a file</h3>
<p>Sometimes, we just want to check if we have a specific file in an archive.&#160; For example, if we are accessing a tape drive (at <font face="Courier New">/dev/st0</font>), we can lis<strong>t</strong> (the <strong>t</strong> in the option) the content using</p>
<blockquote><p><font face="Courier New"># tar tvf /dev/st0</font></p>
</blockquote>
<p>More often than not, the listing will be too long for us.&#160; We can pipe the output to grep.</p>
<blockquote><p><font face="Courier New"># tar tvf /dev/st0 | grep &lt;string-to-match&gt;</font></p>
</blockquote>
<p>Hope this is short enough.&#160; Leave a comment if you want to ask questions pertaining to <font face="Courier New">tar</font>.</p>
<p> <!--adsense#1--></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/">Short and quick tutorial for the command “tar”</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “find”">Short and quick tutorial for the command “find”</a></li><li><a href="http://www.susetips.com/2009/05/05/short-and-quick-tutorial-for-the-command-touch/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “touch”">Short and quick tutorial for the command “touch”</a></li><li><a href="http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/" rel="bookmark" title="Permanent Link: Using the “date” command and it’s % options">Using the “date” command and it’s % options</a></li><li><a href="http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/" rel="bookmark" title="Permanent Link: Using command output with backquotes">Using command output with backquotes</a></li><li><a href="http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/" rel="bookmark" title="Permanent Link: Using redirections: 2>&#038;1 (Part 2 of 2)">Using redirections: 2>&#038;1 (Part 2 of 2)</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What are .Z, .gz and .bz2 files?</title>
		<link>http://www.susetips.com/2009/04/15/what-are-z-gz-and-bz2-files/</link>
		<comments>http://www.susetips.com/2009/04/15/what-are-z-gz-and-bz2-files/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 07:04:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[utility]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[compression]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/04/15/what-are-z-gz-and-bz2-files/</guid>
		<description><![CDATA[As part of a tarball distribution and also other compressed files, you will come across files with the .Z, .gz and .bz2 extensions.&#160; These are basically files that have been compressed using different applications, much like the .zip files predominantly found in the Windows environment. compress for .Z files The UNIX command compress is used [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/15/what-are-z-gz-and-bz2-files/">What are .Z, .gz and .bz2 files?</a></p>
]]></description>
			<content:encoded><![CDATA[<p>As part of a tarball distribution and also other compressed files, you will come across files with the <font face="Courier New">.Z</font>, <font face="Courier New">.gz</font> and <font face="Courier New">.bz2</font> extensions.&#160; These are basically files that have been compressed using different applications, much like the .zip files predominantly found in the Windows environment.</p>
<p><img title="file-compression" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="220" alt="file-compression" src="http://www.susetips.com/wp-content/uploads/2009/04/filecompression.jpg" width="220" border="0" /> </p>
<p> <span id="more-130"></span><br />
<h3><font face="Courier New">compress</font> for <font face="Courier New">.Z</font> files</h3>
<p>The UNIX command <font face="Courier New">compress</font> is used to create and extract files with the <font face="Courier New">.Z</font> extension.&#160; Unfortunately, this is not available on SuSE.&#160; If you need to uncompress <font face="Courier New">.Z</font> files that you downloaded, you can use the command <font face="Courier New">zcat</font>.</p>
<h3><font face="Courier New">gzip</font> and <font face="Courier New">gunzip</font> for <font face="Courier New">.gz</font> files</h3>
<p>This is the more common compression program and algorithm that’s used with Linux.</p>
<blockquote><p><font face="Courier New"># gzip &lt;filename&gt;        <br /># gunzip &lt;filename&gt;.gz</font></p>
</blockquote>
<h3><font face="Courier New">bzip2</font> and <font face="Courier New">bunzip2</font> for <font face="Courier New">.bz2</font> files</h3>
<p>Known to have a more superior compression ratio than <font face="Courier New">gzip</font> but less frequently used.</p>
<blockquote><p><font face="Courier New"># bzip2 &lt;filename&gt;        <br /># bunzip2 &lt;filename&gt;.bz2</font></p>
</blockquote>
<h3><font face="Courier New">zip</font> and <font face="Courier New">unzip</font> for <font face="Courier New">.zip</font> files</h3>
<p>Being in a world where Windows seems to be the norm, we can’t avoid receiving file that’s compressed with WinZIP or other tools that create <font face="Courier New">.zip</font> file.&#160; Luckily for us, we have zip and unzip for these files.</p>
<blockquote><p><font face="Courier New"># zip &lt;archive&gt;.ZIP &lt;filenames&gt;        <br /># unzip &lt;archive&gt;.ZIP</font></p>
</blockquote>
<p>Please comment if you have any further questions.</p>
<p> <!--adsense#1--></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/15/what-are-z-gz-and-bz2-files/">What are .Z, .gz and .bz2 files?</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “tar”">Short and quick tutorial for the command “tar”</a></li><li><a href="http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “find”">Short and quick tutorial for the command “find”</a></li><li><a href="http://www.susetips.com/2009/04/04/tripwire-open-source-security-utility/" rel="bookmark" title="Permanent Link: Tripwire : Open Source Security Utility">Tripwire : Open Source Security Utility</a></li><li><a href="http://www.susetips.com/2009/04/19/using-redirections-21-part-2-of-2/" rel="bookmark" title="Permanent Link: Using redirections: 2>&#038;1 (Part 2 of 2)">Using redirections: 2>&#038;1 (Part 2 of 2)</a></li><li><a href="http://www.susetips.com/2009/04/13/what-is-a-tarball/" rel="bookmark" title="Permanent Link: What is a tarball?">What is a tarball?</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/04/15/what-are-z-gz-and-bz2-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short and quick tutorial for the command “find”</title>
		<link>http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/</link>
		<comments>http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 06:30:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[desktop]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/</guid>
		<description><![CDATA[We can learn about commands in Linux using the manpages, for example, to learn how to use the find command, we can just do # man 1 find However, this means we need to read the long manual and generally most of us are somewhat impatient.&#160; We will give short and quick tutorials on the [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/">Short and quick tutorial for the command “find”</a></p>
]]></description>
			<content:encoded><![CDATA[<p>We can learn about commands in Linux using the manpages, for example, to learn how to use the find command, we can just do</p>
<blockquote><p># man 1 find</p>
</blockquote>
<p>However, this means we need to read the long manual and generally most of us are somewhat impatient.&#160; We will give short and quick tutorials on the common usage of the commands.</p>
<p>  <span id="more-84"></span>
<p>The find command is to search for files, directories, pipes, sockets, devices (anything that is defined as files in Linux) in the system.&#160; The quickest tutorial is</p>
<blockquote><p># find / –name &lt;filename&gt;</p>
</blockquote>
<p>The ‘/’ tells the command to search from the root directory, another common variable here is ‘.’, which means to search from this directory onwards.</p>
<p>The ‘-name &lt;filename&gt;’ specifies the file that you want to look for, e.g. proposal.txt as the filename.</p>
<p>That’s the shortest tutorial we can think of for “find”.&#160; For more advance stuff, “man 1 find”.</p>
<p><!--adsense#1--></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/">Short and quick tutorial for the command “find”</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/04/16/short-and-quick-tutorial-for-the-command-tar/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “tar”">Short and quick tutorial for the command “tar”</a></li><li><a href="http://www.susetips.com/2009/05/05/short-and-quick-tutorial-for-the-command-touch/" rel="bookmark" title="Permanent Link: Short and quick tutorial for the command “touch”">Short and quick tutorial for the command “touch”</a></li><li><a href="http://www.susetips.com/2010/01/12/how-to-install-gnomekde-desktop-environment-on-opensuse-11/" rel="bookmark" title="Permanent Link: How to install Gnome/KDE Desktop Environment on OpenSuse 11">How to install Gnome/KDE Desktop Environment on OpenSuse 11</a></li><li><a href="http://www.susetips.com/2009/04/17/using-the-date-command-and-its-options/" rel="bookmark" title="Permanent Link: Using the “date” command and it’s % options">Using the “date” command and it’s % options</a></li><li><a href="http://www.susetips.com/2009/05/05/using-command-output-with-backquotes/" rel="bookmark" title="Permanent Link: Using command output with backquotes">Using command output with backquotes</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/04/05/short-and-quick-tutorial-for-the-command-find/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What’s the difference between “su” and “su –”?</title>
		<link>http://www.susetips.com/2009/03/06/whats-the-difference-between-su-and-su/</link>
		<comments>http://www.susetips.com/2009/03/06/whats-the-difference-between-su-and-su/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 11:54:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.susetips.com/2009/03/06/whats-the-difference-between-su-and-su/</guid>
		<description><![CDATA[We get asked this question quite often and maybe it is good to give a simple explanation.  “su” by itself means that you would like to assume the super user identity.  You can also assume the identity of another user using “su &#60;userid&#62;”. Then, many people actually ask why do we usually type “su –” [...]<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/03/06/whats-the-difference-between-su-and-su/">What’s the difference between “su” and “su –”?</a></p>
]]></description>
			<content:encoded><![CDATA[<div class="mceTemp mceIEcenter">
<dl id="attachment_50" class="wp-caption aligncenter" style="width: 310px;">
<dt class="wp-caption-dt"><img class="size-medium wp-image-50" title="suse-terminal" src="http://www.susetips.com/wp-content/uploads/2009/03/suse-terminal-300x225.jpg" alt="opensuse terminal" width="300" height="225" /></dt>
</dl>
</div>
<p>We get asked this question quite often and maybe it is good to give a simple explanation.  “<span style="font-family: Courier New;">su”</span> by itself means that you would like to assume the super user identity.  You can also assume the identity of another user using “<span style="font-family: Courier New;">su &lt;userid&gt;”</span>.<br />
<span id="more-48"></span><br />
Then, many people actually ask why do we usually type “<span style="font-family: Courier New;">su –</span>” instead of just “<span style="font-family: Courier New;">su</span>”?  The main difference is that the one with the “<span style="font-family: Courier New;">-</span>“ will run the to-be-assumed userid’s startup scripts which will basically mean that you will have the environment settings (such as $PATH) as though you are logged in as the new userid.  Without the “<span style="font-family: Courier New;">-</span>“, you will have the environment settings of the current userid (probably your userid).<br />
<!--adsense#1--></p>
<p>Post from: <a href="http://www.susetips.com">Suse & OpenSuse Tips</a><br />
-----------------------------------------------------------------------<br /></p>
<p><a href="http://www.susetips.com/2009/03/06/whats-the-difference-between-su-and-su/">What’s the difference between “su” and “su –”?</a></p>
<p>---<br />Related Articles at Suse &amp; OpenSuse Tips:<ul><li><a href="http://www.susetips.com/2009/05/29/differential-backup-script-sample/" rel="bookmark" title="Permanent Link: Differential backup script sample">Differential backup script sample</a></li></ul></p><br />]]></content:encoded>
			<wfw:commentRss>http://www.susetips.com/2009/03/06/whats-the-difference-between-su-and-su/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
