<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Add &#8220;sudo&#8221; to the Last Command Typed</title>
	<atom:link href="http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/feed/" rel="self" type="application/rss+xml" />
	<link>http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/</link>
	<description>News, Tips, and How-Tos for Ubuntu Linux</description>
	<lastBuildDate>Mon, 09 Jan 2012 11:59:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Sudo !! &#124; I Learned Something New</title>
		<link>http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/#comment-168452</link>
		<dc:creator>Sudo !! &#124; I Learned Something New</dc:creator>
		<pubDate>Sun, 07 Aug 2011 15:16:51 +0000</pubDate>
		<guid isPermaLink="false">http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/#comment-168452</guid>
		<description>[...] in Linux where I run them but I forgot to run them with sudo. It turns out (thanks to this website http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/) you can run the last command with sudo using sudo [...]</description>
		<content:encoded><![CDATA[<p>[...] in Linux where I run them but I forgot to run them with sudo. It turns out (thanks to this website <a href="http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/" rel="nofollow">http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/</a>) you can run the last command with sudo using sudo [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: said, said,</title>
		<link>http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/#comment-43499</link>
		<dc:creator>said, said,</dc:creator>
		<pubDate>Sun, 28 Dec 2008 14:52:04 +0000</pubDate>
		<guid isPermaLink="false">http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/#comment-43499</guid>
		<description>More on that.

!! for last command.
!$ for last argument of last command.
!-2 for second last command.
!:0 for 0th part (i.e. command name) of last command.
!:3 for 3rd part (i.e. 3rd argument) of last command.
!:3-5 for 3rd to 5th parts of last command.
!-2:3-5 for 3rd to 5th parts of second last command.

For more, see EXPANSION section on bash&#039;s manpage.

I always forget what is keyword for last argument, is it !$, is it $!, is it !!? Can&#039;t memorize all the syntax. 

Suppose I type the following code and I&#039;m not sure !$ is what I want, so I&#039;m afraid to press enter, thinking &quot;what if !$ is the whole last command?&quot;
mv *.txt !$

In that case echo is useful.

echo mv *.txt !$

Or add following line to ~/.bashrc :

bind Space:magic-space

Now things like !! and !$ expands automatically after spaces.</description>
		<content:encoded><![CDATA[<p>More on that.</p>
<p>!! for last command.<br />
!$ for last argument of last command.<br />
!-2 for second last command.<br />
!:0 for 0th part (i.e. command name) of last command.<br />
!:3 for 3rd part (i.e. 3rd argument) of last command.<br />
!:3-5 for 3rd to 5th parts of last command.<br />
!-2:3-5 for 3rd to 5th parts of second last command.</p>
<p>For more, see EXPANSION section on bash&#8217;s manpage.</p>
<p>I always forget what is keyword for last argument, is it !$, is it $!, is it !!? Can&#8217;t memorize all the syntax. </p>
<p>Suppose I type the following code and I&#8217;m not sure !$ is what I want, so I&#8217;m afraid to press enter, thinking &#8220;what if !$ is the whole last command?&#8221;<br />
mv *.txt !$</p>
<p>In that case echo is useful.</p>
<p>echo mv *.txt !$</p>
<p>Or add following line to ~/.bashrc :</p>
<p>bind Space:magic-space</p>
<p>Now things like !! and !$ expands automatically after spaces.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iampriteshdesai</title>
		<link>http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/#comment-40078</link>
		<dc:creator>iampriteshdesai</dc:creator>
		<pubDate>Sat, 22 Nov 2008 10:54:52 +0000</pubDate>
		<guid isPermaLink="false">http://tombuntu.com/index.php/2007/07/13/add-sudo-to-the-last-command-typed/#comment-40078</guid>
		<description>You can also try to type the same command again with minimal effort:
First type sudo  and then hit the up arrow key. That will print the previous command</description>
		<content:encoded><![CDATA[<p>You can also try to type the same command again with minimal effort:<br />
First type sudo  and then hit the up arrow key. That will print the previous command</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)

Served from: tombuntu.com @ 2012-02-08 11:50:25 -->
