<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux Swords &#187; bash cmdline</title>
	<atom:link href="http://blog.mjava.ch/tag/bash-cmdline/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mjava.ch</link>
	<description>kids, baduk und cmd-lines</description>
	<lastBuildDate>Thu, 23 Dec 2010 12:01:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>more cmdlines [linux-user only]</title>
		<link>http://blog.mjava.ch/2008/10/20/more-cmdlines-linux-user-only/</link>
		<comments>http://blog.mjava.ch/2008/10/20/more-cmdlines-linux-user-only/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 20:19:40 +0000</pubDate>
		<dc:creator>mjava</dc:creator>
				<category><![CDATA[cmd-lines]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[bash cmdline]]></category>

		<guid isPermaLink="false">http://blog.mjava.ch/2008/10/20/more-cmdlines-linux-user-only/</guid>
		<description><![CDATA[I recently learned and relearned more of common cmdlines and oneliners in bash.
Posting them gives me a place to lookup these until I enter them properly into my wiki.
linux-users follow here
copying/moving files/directories for backup:
mv originalfilename.txt{,.backup}
will result in originalfilename.txt.backup
!! will repeat the last command, usefull for adding sudo in front of it: &#8217;sudo !!&#8217;
As for repeating [...]]]></description>
			<content:encoded><![CDATA[<p>I recently learned and relearned more of common cmdlines and oneliners in <em>bash</em>.<br />
Posting them gives me a place to lookup these until I enter them properly into my wiki.</p>
<p>linux-users follow here<span id="more-219"></span></p>
<p>copying/moving files/directories for backup:<br />
<code>mv originalfilename.txt{,.backup}</code><br />
will result in <em>originalfilename.txt.backup</em></p>
<p><code>!!</code> will repeat the last command, usefull for adding <em>sudo</em> in front of it: <em>&#8217;sudo !!&#8217;</em></p>
<p>As for repeating the last command, you can also use the <em>&#8216;^a^b&#8217;</em> notation. It will repeat the last command and replace the first &#8216;a&#8217; with a &#8216;b&#8217;. Let&#8217;s see an example:</p>
<p>Let&#8217;s say your last command was <em>tar xzvf somefile-version-1.16.9.tar.gz</em> and you realized that<br />
you should have written &#8216;17&#8242; instead of &#8216;16&#8242;. Here&#8217;s the quickfix:<br />
<code>^16^17</code></p>
<p>If you look at the output of the <em>history </em>  command, you&#8217;ll see the command-number in front of the command. You can use <em>&#8216;!&#8217; </em>  with the number:</p>
<p><code>!534</code></p>
<p>will repeat the command with the number 534.</p>
<p>Another usefull shortcut is <em>&lt;Esc&gt; + &#8216;_&#8217;</em>. This will repeat the last parameter of the last command, usefull when creating new directories and then &#8216;cd&#8217; into them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mjava.ch/2008/10/20/more-cmdlines-linux-user-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

