<?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>the empty quarter &#187; commandline</title>
	<atom:link href="http://www.martinhammer.com/blog/index.php/tag/commandline/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.martinhammer.com/blog</link>
	<description>Sorry, but you are looking for something that isn’t here.</description>
	<lastBuildDate>Sat, 04 Feb 2012 12:33:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Column-wise text manipulation</title>
		<link>http://www.martinhammer.com/blog/index.php/2011/10/column-wise-text-manipulation/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2011/10/column-wise-text-manipulation/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 17:02:14 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=676</guid>
		<description><![CDATA[GNU/Linux includes many utilities for working with text files through the shell. In this post we take a quick look at accessing and manipulating text files in a &#8220;column-wise&#8221; mode. Suppose you have the following two files, each with two columns separated by the TAB character. $cat file1 Alice   Paris Bob     Tokyo Mary    London John    New York $cat file2 [...]]]></description>
			<content:encoded><![CDATA[<p>GNU/Linux includes many utilities for working with text files through the shell. In this post we take a quick look at accessing and manipulating text files in a &#8220;column-wise&#8221; mode.</p>
<p>Suppose you have the following two files, each with two columns separated by the TAB character.<br />
<code><br />
$cat file1<br />
Alice   Paris<br />
Bob     Tokyo<br />
Mary    London<br />
John    New York</code></p>
<p><code> </code></p>
<p><code>$cat file2<br />
13 May    Orange<br />
19 Oct    Blue<br />
11 Nov    Black<br />
29 Feb    Red<br />
</code></p>
<p>The data in the two files are in fact related, i.e. file2 contains the date of birth and favourite colour of the people mentioned in file1 (assuming also that the files are sorted correctly). It would make sense to combine the two files together so that each row has the full data for each person. The <code>paste</code> command does just that.<br />
<code><br />
$paste file1 file2 &gt; file3<br />
$cat file3<br />
Alice   Paris     13 May    Orange<br />
Bob     Tokyo     19 Oct    Blue<br />
Mary    London    11 Nov    Black<br />
John    New York  29 Feb    Red<br />
</code></p>
<p>Suppose that we are only interested in the name and date of birth of each person, and we can discard the hometown and favourite colour information. The <code>cut</code> command is what we shall use:<br />
<code><br />
$cut file3 -f 1,3 &gt; file4<br />
$cat file4<br />
Alice   13 May<br />
Bob     19 Oct<br />
Mary    11 Nov<br />
John    29 Feb<br />
</code></p>
<p>Our next and final requirement is to reorder the columns differently. Instead of having the name followed by date of birth, suppose we want to have the columns the other way round. Unfortunately <code>cat -f 3,1</code> produces exactly the same output as <code>cut -f 1,3</code>, so the <code>cut</code> command will not be sufficient. We have to use <code>sed</code> instead.<br />
<code><br />
$sed -e 's/\([^\t]*\)\t\([^\t]*\)/\2\t\1/' file4 &gt; file5<br />
$cat file5<br />
13 May    Alice<br />
19 Oct    Bob<br />
11 Nov    Mary<br />
29 Feb    John<br />
</code></p>
<p>How does that work? Well \([^\t]*\) is a &#8220;named expression&#8221; which matches all characters except TAB. The search pattern looks for two of them, separated by TAB (\t). In the replace-with part, they are referred to as \2 and \1, again separated by \t.</p>
<p>Of course if file5 was what we ultimately wanted from the beginning as our output, we could have simply piped commands together:<br />
<code><br />
$paste file1 file2 | cut -f 1,3 | sed -e 's/\([^\t]*\)\t\([^\t]*\)/\2\t\1/' &gt; file5<br />
</code></p>
<p>or alternatively<br />
<code><br />
$paste file1 file2 | sed -e 's/\([^\t]*\)\t\([^\t]*\)\t\([^\t]*\)\t\([^\t]*\)/\3\t\1/' &gt; file5<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2011/10/column-wise-text-manipulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove HTML tags with sed</title>
		<link>http://www.martinhammer.com/blog/index.php/2011/10/remove-html-tags-with-sed/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2011/10/remove-html-tags-with-sed/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 12:16:13 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=672</guid>
		<description><![CDATA[Sed can be used to strip out all HTML or XML tags from a file and get the plain text version. Suppose you have file gnulinux.html with the following contents: &#60;p&#62;The combination of &#60;a href=&#8220;/gnu/linux-and-gnu.html&#8220;&#62;GNU and Linux&#60;/a&#62; is the &#60;strong&#62;GNU/Linux operating system&#60;/strong&#62;, now used by millions and sometimes incorrectly called simply &#8220;Linux&#8220;.&#60;/p&#62; Tempting but incorrect [...]]]></description>
			<content:encoded><![CDATA[<p>Sed can be used to strip out all HTML or XML tags from a file and get the plain text version. Suppose you have file gnulinux.html with the following contents:</p>
<p><code><br />
&lt;p&gt;The combination of &lt;a href=&ldquo;/gnu/linux-and-gnu.html&ldquo;&gt;GNU and Linux&lt;/a&gt; is the &lt;strong&gt;GNU/Linux operating system&lt;/strong&gt;, now used by millions and sometimes incorrectly called simply &ldquo;Linux&ldquo;.&lt;/p&gt;<br />
</code></p>
<p>Tempting but incorrect &#8211; sed finds the longest possible match which in this case is the entire file, and thus will output nothing:<br />
<code><br />
$sed -e 's/&lt;.*&gt;//g' gnulinux.html<br />
&nbsp;<br />
</code></p>
<p>Correct version:<br />
<code><br />
$sed -e 's/&lt;[^&gt;]*&gt;//g' gnulinux.html<br />
The combination of GNU and Linux is the GNU/Linux operating system, now used by millions and sometimes incorrectly called simply &ldquo;Linux&ldquo;.<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2011/10/remove-html-tags-with-sed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove empty lines from file</title>
		<link>http://www.martinhammer.com/blog/index.php/2010/09/remove-empty-lines-from-file/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2010/09/remove-empty-lines-from-file/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 16:50:07 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[commandline]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=589</guid>
		<description><![CDATA[Here&#8217;s a quick way to remove empty lines from a file using the Linux command line: cat file1 &#124; sed /^$/d &#62; file2 Where file1 is the input file containing empty lines and file2 is a newly created file with empty lines removed.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Here&#8217;s a quick way to remove empty lines from a file using the Linux command line:</p>
<p style="text-align: left;"><code>cat file1 | sed /^$/d &gt; file2</code></p>
<p style="text-align: left;">Where file1 is the input file containing empty lines and file2 is a newly created file with empty lines removed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2010/09/remove-empty-lines-from-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change SSH port number on Ubuntu server</title>
		<link>http://www.martinhammer.com/blog/index.php/2010/09/how-to-change-ssh-port-number-on-ubuntu-server/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2010/09/how-to-change-ssh-port-number-on-ubuntu-server/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 08:56:48 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=562</guid>
		<description><![CDATA[Changing the port number of SSH daemon is a quick way of reducing the number of SSH brute force attacks your server might face (check the file /var/log/auth.log to see if there are many failed SSH login attempts). Just to be on the safe side, create a backup copy of the SSH daemon config file. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Changing the port number of SSH daemon is a quick way of reducing the number of SSH brute force attacks your server might face (check the file <code>/var/log/auth.log</code> to see if there are many failed SSH login attempts).</p>
<ol style="text-align: left;">
<li>Just to be on the safe side, create a backup copy of the SSH daemon config file.<br />
<code><br />
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.vanilla</p>
<p></code></li>
<li>Edit the config file.<br />
<code><br />
sudo vi /etc/ssh/sshd_config</p>
<p></code></li>
<li>Change the port number on the following line, e.g. to 2201 or some other unused port. Make sure you note down the port number.<br />
<code><br />
Port 22</p>
<p></code></li>
<li>Restart the SSH daemon. You might get kicked out of your existing session.<br />
<code><br />
sudo /etc/init.d/ssh restart</p>
<p></code></li>
<li>When you login next remember to include the correct port.<br />
<code><br />
ssh youruser@yourserver -p 2201</p>
<p></code></li>
</ol>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2010/09/how-to-change-ssh-port-number-on-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tuxradar: Command line tricks for smart geeks</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/12/tuxradar-command-line-tricks-for-smart-geeks/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/12/tuxradar-command-line-tricks-for-smart-geeks/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 13:46:40 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[commandline]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=393</guid>
		<description><![CDATA[Good article on Tuxradar with some clever command line hacks: Command line tricks for smart geeks]]></description>
			<content:encoded><![CDATA[<p>Good article on Tuxradar with some clever command line hacks: <a href="http://www.tuxradar.com/content/command-line-tricks-smart-geeks">Command line tricks for smart geeks</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/12/tuxradar-command-line-tricks-for-smart-geeks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use commandline to find CentOS version</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/11/use-commandline-to-find-centos-version/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/11/use-commandline-to-find-centos-version/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 17:58:42 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[commandline]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=374</guid>
		<description><![CDATA[Here&#8217;s how to find the version of your CentOS system from the command line: more /etc/redhat-release]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Here&#8217;s how to find the version of your CentOS system from the command line:</p>
<p><code>more /etc/redhat-release</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/11/use-commandline-to-find-centos-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change virtual terminal font size</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/09/change-virtual-terminal-font-size/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/09/change-virtual-terminal-font-size/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 05:28:14 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=344</guid>
		<description><![CDATA[This post is about how to change the resolution (i.e. font size) of virtual terminals or &#8220;tty&#8221; in Linux. Virtual terminal is the basic command line interface which you see when you press &#60;Ctrl&#62;&#60;Alt&#62;&#60;F1&#62; (note: to get back to your existing Gnome or KDE session press &#60;Alt&#62;&#60;F7&#62;). This is different from the Terminal emulator, such [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">This post is about how to change the resolution (i.e. font size) of virtual terminals or &#8220;tty&#8221; in Linux. Virtual terminal is the basic command line interface which you see when you press &lt;Ctrl&gt;&lt;Alt&gt;&lt;F1&gt;  (note: to get back to your existing Gnome or KDE session press &lt;Alt&gt;&lt;F7&gt;). This is different from the Terminal emulator, such as the Terminal application in Gnome.</p>
<p style="text-align: left;">To change the font size of the virtual terminal it is necessary to set the vga parameter in the entry used by the Grub bootloader to start up Linux. Follow the steps below to set the entry correctly.</p>
<ol>
<li>First, intall the hwinfo utility through Synaptic or Terminal:<br />
<code><br />
sudo apt-get install hwinfo </p>
<p> </code></li>
<li>Then run the following command in Terminal:<br />
<code><br />
sudo hwinfo --framebuffer </p>
<p> </code></li>
<li>The command will output some information about your graphics system. Skip the top bit and you should see a list of entries like this:<br />
<code><br />
Mode 0x0300: 640x400 (+640), 8 bits<br />
Mode 0x0301: 640x480 (+640), 8 bits<br />
Mode 0x0303: 800x600 (+800), 8 bits<br />
Mode 0x0305: 1024x768 (+1024), 8 bits<br />
Mode 0x0307: 1280x1024 (+1280), 8 bits<br />
Mode 0x0317: 1024x768 (+2048), 16 bits<br />
Mode 0x0318: 1024x768 (+4096), 24 bits </p>
<p> </code>
</li>
<li>Review the list which might be quite long, select the resolution you want to use and copy the hexadecimal number after Mode. For example, for 24 bit 1024&#215;786 resolution the number is 0&#215;0318.</li>
<li>Still in the Terminal emulator, run the following command to edit the Grub bootloader configuration file:<br />
<code><br />
gksudo gedit /boot/grub/menu.lst </p>
<p> </code>
</li>
<li>Find the entry you want to edit (or copy an existing entry and give it a different name) and change the line which begins with &#8220;kernel&#8221;. As a precaution, make sure you have at least one entry left in the file without the new resolution so you can still safely boot and edit the file again if necessary.<br />&nbsp;<br />Original entry:<br />
<code><br />
kernel		/boot/vmlinuz-2.6.28-15-server root=/dev/sda3 ro quiet splash </p>
<p> </code><br />
New entry:<br />
<code><br />
kernel		/boot/vmlinuz-2.6.28-15-server root=/dev/sda3 ro quiet vga=0x0318 splash </p>
<p> </code>
</li>
<li>Reboot your computer and at the Grub menu select the entry which was edited. You may notice some difference during the boot process, to verify that the resolution and font size are suitable press &lt;Ctrl&gt;&lt;Alt&gt;&lt;F8&gt; once you are at the login screen. This will take you to tty8 which should display messages from the boot process.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/09/change-virtual-terminal-font-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Split large files</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/09/split-large-files/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/09/split-large-files/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 14:33:20 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[commandline]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=335</guid>
		<description><![CDATA[Sometimes it is necessary to split a large file into several smaller ones, for example so that they fit on a CD or USB disk or can be attached to email. It&#8217;s very easy to do this from command line. Suppose you have a file of 500 MiB called &#8220;large_file&#8221; and to split it into [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Sometimes it is necessary to split a large file into several smaller ones, for example so that they fit on a CD or USB disk or can be attached to email. It&#8217;s very easy to do this from command line.</p>
<p style="text-align: left;">Suppose you have a file of 500 MiB called &#8220;large_file&#8221; and to split it into 5 files of 100 MiB each:</p>
<p><code>split --bytes=100m large_file large_file_part_</code></p>
<p style="text-align: left;">This will create 5 files with names as follows:</p>
<p><code>large_file_part_aa<br />
large_file_part_ab<br />
large_file_part_ac<br />
large_file_part_ad<br />
large_file_part_ae<br />
</code></p>
<p style="text-align: left;">The following command would then be used to join the parts back together:</p>
<p><code>cat large_file_part_* > large_file</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/09/split-large-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mount NTFS disk from commandline</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/06/mount-ntfs-disk-from-commandline/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/06/mount-ntfs-disk-from-commandline/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 15:56:09 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=247</guid>
		<description><![CDATA[Nautilus and Thunar sometimes refuse to mount NTFS disk (e.g. a USB hard drive) when it was previously not unmounted cleanly from Windows. It is still possible to mount it from terminal shell by using the following command: sudo mount -t ntfs-3g -o force /dev/sdc1 /media/myntfsdisk Where /dev/sdc1 is the device you want to mount [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Nautilus and Thunar sometimes refuse to mount NTFS disk (e.g. a USB hard drive) when it was previously not unmounted cleanly from Windows. It is still possible to mount it from terminal shell by using the following command:</p>
<p><code>sudo mount -t ntfs-3g -o force /dev/sdc1 /media/myntfsdisk</code></p>
<p style="text-align: left;">Where <code>/dev/sdc1</code> is the device you want to mount and <code>/media/myntfsdisk</code> is the mount point.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/06/mount-ntfs-disk-from-commandline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check installed packages from commandline</title>
		<link>http://www.martinhammer.com/blog/index.php/2009/05/check-installed-packages-from-commandline/</link>
		<comments>http://www.martinhammer.com/blog/index.php/2009/05/check-installed-packages-from-commandline/#comments</comments>
		<pubDate>Thu, 28 May 2009 13:31:24 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.martinhammer.com/blog/?p=233</guid>
		<description><![CDATA[To check for installed packages from the command line, use the dpkg command with the --get-selections option. This returns all packages installed on your system (most likely a lot!). So it is best to use grep to narrow down the search results. For example, the following command lists all packages with &#8220;fire&#8221; in the package [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">To check for installed packages from the command line, use the <code>dpkg</code> command with the <code>--get-selections</code> option. This returns all packages installed on your system (most likely a lot!). So it is best to use <code>grep</code> to narrow down the search results. For example, the following command lists all packages with &#8220;fire&#8221; in the package name:</p>
<p><code>dpkg --get-selections | grep fire<br />
firefox&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;install<br />
firefox-3.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;install<br />
firefox-3.0-branding&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;install<br />
firefox-3.0-dom-inspector&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;install<br />
firefox-dom-inspector&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;install<br />
mozilla-firefox-locale-en-gb&nbsp;&nbsp;&nbsp;install<br />
</code></p>
<p style="text-align: left;">An alternative which shows more information, including the exact version of the package and a description is the <code>-l</code> option. Because <code>grep</code> works with the output of the <code>dpkg</code> command, this will also include packages where the search term appears in the description, such as ufw on the last line in the output below because of &#8220;firewall&#8221;.<br />
<code><br />
$ dpkg -l | grep fire<br />
ii&nbsp;firefox &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.0.10+nobinonly-0ubuntu0.9.04.1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;meta&nbsp;package&nbsp;for&nbsp;the&nbsp;popular&nbsp;mozilla&nbsp;web&nbsp;bro<br />
ii&nbsp;firefox-3.0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.0.10+nobinonly-0ubuntu0.9.04.1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;safe&nbsp;and&nbsp;easy&nbsp;web&nbsp;browser&nbsp;from&nbsp;Mozilla<br />
ii&nbsp;firefox-3.0-branding &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.0.10+nobinonly-0ubuntu0.9.04.1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Package&nbsp;that&nbsp;ships&nbsp;the&nbsp;firefox&nbsp;branding<br />
ii&nbsp;firefox-3.0-dom-inspector &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.0.10+nobinonly-0ubuntu0.9.04.1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dummy&nbsp;upgrade&nbsp;package&nbsp;for&nbsp;firefox-3.0-dom-in<br />
ii&nbsp;firefox-dom-inspector &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.0.10+nobinonly-0ubuntu0.9.04.1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;meta&nbsp;package&nbsp;for&nbsp;firefox-dom-inspector<br />
ii&nbsp;mozilla-firefox-locale-en-gb &nbsp;&nbsp;&nbsp;2.0.0.7+1-0ubuntu4 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mozilla&nbsp;Firefox&nbsp;English&nbsp;language/region&nbsp;pack<br />
ii&nbsp;ufw &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.27-0ubuntu2 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;program&nbsp;for&nbsp;managing&nbsp;a&nbsp;netfilter&nbsp;firewall<br />
</code></p>
<p style="text-align: left;">Using the above commands can be a faster and more efficient alternative to searching for installed packages in Synaptic.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.martinhammer.com/blog/index.php/2009/05/check-installed-packages-from-commandline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

