<?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>Software Developer, Web Developer and Linux Expert - Adam Spotton &#187; Bash</title>
	<atom:link href="http://www.adamspotton.com/category/linux/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adamspotton.com</link>
	<description>Software Developer, Web Developer and Linux Expert</description>
	<lastBuildDate>Mon, 15 Aug 2011 21:15:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The &#8216;!!&#8217; command of the BASH shell with sudo</title>
		<link>http://www.adamspotton.com/2009/04/100/</link>
		<comments>http://www.adamspotton.com/2009/04/100/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 16:04:57 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.adamspotton.com/?p=100</guid>
		<description><![CDATA[It&#8217;s good security practice to log in to your Linux system as an under privileged user, only to then use commands like sudo to execute the application that you want with root privileges. But what if you log in using a terminal client that isn&#8217;t configured to properly use keys like &#8216;Home&#8217; or &#8216;End&#8217;? I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s good security practice to log in to your Linux system as an under privileged user, only to then use commands like <em>sudo</em> to execute the application that you want with root privileges. But what if you log in using a terminal client that isn&#8217;t configured to properly use keys like &#8216;Home&#8217; or &#8216;End&#8217;? I&#8217;ve found this all too often when using a terminal client on the Windows platform. You&#8217;ll quickly know if the terminal isn&#8217;t set up for it because garbage text will appear inside the terminal screen or maybe even some other random behavior such as the line of text disappearing.</p>
<p>Now, what if you type a really long command into bash through such a terminal client and you forget to prefix it with <em>sudo</em>? You&#8217;d probably end up trying to retype the command or do some form of mouse copy-paste magic to get the command to follow <em>sudo</em>. There&#8217;s an easy solution to this problem! Instead, you can use a feature of the bash shell, &#8216;<code>!!</code>&#8216;, to tell bash that you want it to execute your previously given command.</p>
<p><strong>For instance, if you typed:</strong><br />
<code>nano /etc/resolv.conf</code></p>
<p><strong>But you really meant to type:</strong><br />
<code>sudo nano /etc/resolv.conf</code></p>
<p><strong>You can accomplish the same thing with:</strong><br />
<code>adam@ad:~$ sudo !!<br />
sudo nano /etc/resolv.conf<br />
[sudo] password for adam: </code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamspotton.com/2009/04/100/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.335 seconds -->

