<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tanveer&#039;s Weblog</title>
	<atom:link href="http://neeocis.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://neeocis.wordpress.com</link>
	<description>wanna breath softwares like free air..</description>
	<lastBuildDate>Fri, 30 Dec 2011 11:29:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='neeocis.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tanveer&#039;s Weblog</title>
		<link>http://neeocis.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://neeocis.wordpress.com/osd.xml" title="Tanveer&#039;s Weblog" />
	<atom:link rel='hub' href='http://neeocis.wordpress.com/?pushpress=hub'/>
		<item>
		<title>C++/CLI: Object Clone</title>
		<link>http://neeocis.wordpress.com/2011/12/19/ccli-object-clone-2/</link>
		<comments>http://neeocis.wordpress.com/2011/12/19/ccli-object-clone-2/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 15:32:51 +0000</pubDate>
		<dc:creator>Tanveer</dc:creator>
		
		<guid isPermaLink="false">http://neeocis.wordpress.com/?p=312</guid>
		<description><![CDATA[C++/CLI: Object Clone.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=312&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href='http://wp.me/pcBB6-24'>C++/CLI: Object Clone</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/neeocis.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/neeocis.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/neeocis.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/neeocis.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/neeocis.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/neeocis.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/neeocis.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/neeocis.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/neeocis.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/neeocis.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/neeocis.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/neeocis.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/neeocis.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/neeocis.wordpress.com/312/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=312&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://neeocis.wordpress.com/2011/12/19/ccli-object-clone-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5bfefeca90549cba372124e62d71c4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">neeocis</media:title>
		</media:content>
	</item>
		<item>
		<title>[Linux] Vi editor basics</title>
		<link>http://neeocis.wordpress.com/2011/06/21/linux-vi-editor-basics/</link>
		<comments>http://neeocis.wordpress.com/2011/06/21/linux-vi-editor-basics/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 10:52:14 +0000</pubDate>
		<dc:creator>Tanveer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[how to have color in vi editor]]></category>
		<category><![CDATA[vi editor]]></category>
		<category><![CDATA[vi editor basics]]></category>
		<category><![CDATA[vi editor cheatsheet]]></category>
		<category><![CDATA[vi editor command for everyday use]]></category>
		<category><![CDATA[vi editor commands]]></category>

		<guid isPermaLink="false">http://neeocis.wordpress.com/?p=302</guid>
		<description><![CDATA[In everyday in our Linux life we may need to use vi editor. So do I. The main cause of this post is to know how simple vi editor is! Installing Vi editor sudo apt-get install vim *it will also load color of you vi edior Opening a file vi filename Creating text Edit modes: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=302&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre><a name="Vi"></a>
In everyday in our Linux life we may need to use vi editor. So do I. The main cause of this post is to know how simple vi editor is!

<span style="text-decoration:underline;"><strong>Installing Vi editor</strong></span>
sudo apt-get install vim

*it will also load color of you vi edior

<span style="text-decoration:underline;"><strong>Opening a file</strong></span>
vi filename

<span style="text-decoration:underline;"><strong>Creating text</strong></span>
Edit modes: These keys enter editing modes and type in the text
of your document. 

i     Insert before current cursor position
I     Insert at beginning of current line
a     Insert (append) after current cursor position
A     Append to end of line
r     Replace 1 character
R     Replace mode
&lt;ESC&gt; Terminate insertion or overwrite mode

<strong><span style="text-decoration:underline;">Going to VISUAL mode:</span></strong>
If you want visual then from command mode just hit "v" 

v    it will allow to switch in visual mode

<span style="text-decoration:underline;"><strong>Deletion of text</strong></span>

x     Delete single character
dd    Delete current line and put in buffer
ndd   Delete n lines (n is a number) and put them in buffer
J     Attaches the next line to the end of the current line (deletes carriage return).

<span style="text-decoration:underline;"><strong>Undo:</strong></span>
u     Undo last command

<span style="text-decoration:underline;"><strong>cut and paste</strong></span>
yy    Yank current line into buffer
nyy   Yank n lines into buffer
p     Put the contents of the buffer after the current line
P     Put the contents of the buffer before the current line

<span style="text-decoration:underline;"><strong>cursor positioning</strong></span>
^d    Page down
^u    Page up
:n    Position cursor at line n
:$    Position cursor at end of file
^g    Display current line number
h,j,k,l Left,Down,Up, and Right respectivly. Your arrow keys should also work if your keyboard mappings are anywhere near sane.

<span style="text-decoration:underline;"><strong>string substitution</strong></span>

:n1,n2:s/string1/string2/[g]       Substitute string2 for string1 on lines
                                   n1 to n2. If g is included (meaning global),
                                   all instances of string1 on each line
                                   are substituted. If g is not included,
                                   only the first instance per matching line is
                                   substituted.

    ^ matches start of line
    . matches any single character
    $ matches end of line

These and other "special characters" (like the forward slash) can be "escaped" with \
i.e to match the string "/usr/STRIM100/SOFT" say "\/usr\/STRIM100\/SOFT" 

<strong>Examples:</strong>

:1,$:s/dog/cat/g                   Substitute 'cat' for 'dog', every instance
                                   for the entire file - lines 1 to $ (end of file)

:23,25:/frog/bird/                 Substitute 'bird' for 'frog' on lines
                                   23 through 25. Only the first instance
                                   on each line is substituted.

<span style="text-decoration:underline;"><strong>Saving and quitting and other "ex" commands</strong></span>

These commands are all prefixed by pressing colon (:) and then entered in the lower
left corner of the window. They are called "ex" commands because they are commands
of the <em><strong>ex</strong></em> text editor - the precursor line editor to the screen editor
vi.   You cannot enter an "ex" command when you are in an edit mode (typing text onto the screen)
Press &lt;ESC&gt; to exit from an editing mode.

:w                Write the current file.
:w new.file       Write the file to the name 'new.file'.
:w! existing.file Overwrite an existing file with the file currently being edited.
:wq               Write the file and quit.
:q                Quit.
:q!               Quit with no changes.

:e filename       Open the file 'filename' for editing.

:set number       Turns on line numbering
:set nonumber     Turns off line numbering

i think it will help someone!
 <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/neeocis.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/neeocis.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/neeocis.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/neeocis.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/neeocis.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/neeocis.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/neeocis.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/neeocis.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/neeocis.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/neeocis.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/neeocis.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/neeocis.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/neeocis.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/neeocis.wordpress.com/302/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=302&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://neeocis.wordpress.com/2011/06/21/linux-vi-editor-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5bfefeca90549cba372124e62d71c4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">neeocis</media:title>
		</media:content>
	</item>
		<item>
		<title>Unix/Linux Commands for everyday use</title>
		<link>http://neeocis.wordpress.com/2011/06/21/unixlinux-commands-for-everyday-use/</link>
		<comments>http://neeocis.wordpress.com/2011/06/21/unixlinux-commands-for-everyday-use/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 10:34:19 +0000</pubDate>
		<dc:creator>Tanveer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[basic linux commands]]></category>
		<category><![CDATA[linux commands]]></category>
		<category><![CDATA[linux commands for daily use]]></category>
		<category><![CDATA[linux commands for everyday use]]></category>

		<guid isPermaLink="false">http://neeocis.wordpress.com/?p=298</guid>
		<description><![CDATA[I have enlisted Unix/Linux commands for everyday use. Hope this list may also help someone. dir navigation • cd - Go to previous directory • cd Go to $HOME directory (cd dir &#38;&#38; command) Go to dir, execute command and return to current dir • pushd . Put current dir on stack so you can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=298&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have enlisted Unix/Linux commands for everyday use. Hope this list may also help someone.</p>
<table class="pixelbeat">
<tbody>
<tr class="pbtitle">
<td colspan="3"><strong>dir navigation</strong></td>
</tr>
<tr>
<td>•</td>
<td class="nw">cd -</td>
<td>Go to previous directory</td>
</tr>
<tr>
<td>•</td>
<td class="nw">cd</td>
<td>Go to $HOME directory</td>
</tr>
<tr>
<td></td>
<td class="nw">(cd dir &amp;&amp; command)</td>
<td>Go to dir, execute command and return to current dir</td>
</tr>
<tr>
<td>•</td>
<td class="nw">pushd <strong>.</strong></td>
<td>Put current dir on stack so you can <strong>popd</strong> back to it</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>file searching</strong></td>
</tr>
<tr>
<td>•</td>
<td class="nw"><a href="http://www.pixelbeat.org/settings/.bashrc">alias</a> l=&#8217;ls -l &#8211;color=auto&#8217;</td>
<td>quick dir listing</td>
</tr>
<tr>
<td>•</td>
<td class="nw">ls -lrt</td>
<td>List files by date. See also <a href="http://www.pixelbeat.org/scripts/newest">newest</a> and <a href="http://www.pixelbeat.org/scripts/find_mm_yyyy">find_mm_yyyy</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">ls /usr/bin | pr -T9 -W$COLUMNS</td>
<td>Print in 9 columns to width of terminal</td>
</tr>
<tr>
<td></td>
<td class="nw">find -name &#8216;*.[ch]&#8216; | xargs grep -E &#8216;expr&#8217;</td>
<td>Search &#8216;expr&#8217; in this dir and below. See also <a href="http://www.pixelbeat.org/scripts/findrepo">findrepo</a></td>
</tr>
<tr>
<td></td>
<td class="nw">find -type f -print0 | xargs -r0 grep -F &#8216;example&#8217;</td>
<td>Search all regular files for &#8216;example&#8217; in this dir and below</td>
</tr>
<tr>
<td></td>
<td class="nw">find -maxdepth 1 -type f | xargs grep -F &#8216;example&#8217;</td>
<td>Search all regular files for &#8216;example&#8217; in this dir</td>
</tr>
<tr>
<td></td>
<td class="nw">find -maxdepth 1 -type d | while <a href="http://www.pixelbeat.org/programming/readline/">read</a> dir; do echo $dir; echo cmd2; done</td>
<td>Process each item with multiple commands (in while loop)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">find -type f ! -perm -444</td>
<td>Find files not readable by all (useful for web site)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">find -type d ! -perm -111</td>
<td>Find dirs not accessible by all (useful for web site)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">locate -r &#8216;file[^/]*\.txt&#8217;</td>
<td>Search cached index for names. This re is like glob *file*.txt</td>
</tr>
<tr>
<td>•</td>
<td class="nw">look reference</td>
<td>Quickly search (sorted) dictionary for prefix</td>
</tr>
<tr>
<td>•</td>
<td class="nw">grep <a href="http://www.pixelbeat.org/settings/.bashrc">&#8211;color</a> reference /usr/share/dict/words</td>
<td>Highlight occurances of regular expression in dictionary</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>archives and compression</strong></td>
</tr>
<tr>
<td></td>
<td class="nw">gpg -c file</td>
<td>Encrypt file</td>
</tr>
<tr>
<td></td>
<td class="nw">gpg file.gpg</td>
<td>Decrypt file</td>
</tr>
<tr>
<td></td>
<td class="nw">tar -c dir/ | bzip2 &gt; dir.tar.bz2</td>
<td>Make compressed archive of dir/</td>
</tr>
<tr>
<td></td>
<td class="nw">bzip2 -dc dir.tar.bz2 | tar -x</td>
<td>Extract archive (use gzip instead of bzip2 for tar.gz files)</td>
</tr>
<tr>
<td></td>
<td class="nw">tar -c dir/ | gzip | gpg -c | ssh user@remote &#8216;dd of=dir.tar.gz.gpg&#8217;</td>
<td>Make encrypted archive of dir/ on remote machine</td>
</tr>
<tr>
<td></td>
<td class="nw">find dir/ -name &#8216;*.txt&#8217; | tar -c &#8211;files-from=- | bzip2 &gt; dir_txt.tar.bz2</td>
<td>Make archive of subset of dir/ and below</td>
</tr>
<tr>
<td></td>
<td class="nw">find dir/ -name &#8216;*.txt&#8217; | xargs cp -a &#8211;target-directory=dir_txt/ &#8211;parents</td>
<td>Make copy of subset of dir/ and below</td>
</tr>
<tr>
<td></td>
<td class="nw">( tar -c /dir/to/copy ) | ( cd /where/to/ &amp;&amp; tar -x -p )</td>
<td>Copy (with permissions) copy/ dir to /where/to/ dir</td>
</tr>
<tr>
<td></td>
<td class="nw">( cd /dir/to/copy &amp;&amp; tar -c <strong>.</strong> ) | ( cd /where/to/ &amp;&amp; tar -x -p )</td>
<td>Copy (with permissions) contents of copy/ dir to /where/to/</td>
</tr>
<tr>
<td></td>
<td class="nw">( tar -c /dir/to/copy ) | ssh -C user@remote &#8216;cd /where/to/ &amp;&amp; tar -x -p&#8217;</td>
<td>Copy (with permissions) copy/ dir to remote:/where/to/ dir</td>
</tr>
<tr>
<td></td>
<td class="nw">dd bs=1M if=/dev/sda | gzip | ssh user@remote &#8216;dd of=sda.gz&#8217;</td>
<td>Backup harddisk to remote machine</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>rsync</strong> (Network efficient file copier: Use the &#8211;dry-run option for testing)</td>
</tr>
<tr>
<td></td>
<td class="nw">rsync -P rsync://rsync.server.com/path/to/file file</td>
<td>Only get diffs. Do multiple times for troublesome downloads</td>
</tr>
<tr>
<td></td>
<td class="nw">rsync &#8211;bwlimit=1000 fromfile tofile</td>
<td>Locally copy with rate limit. It&#8217;s like nice for I/O</td>
</tr>
<tr>
<td></td>
<td class="nw">rsync -az -e ssh &#8211;delete ~/public_html/ remote.com:&#8217;~/public_html&#8217;</td>
<td>Mirror web site (using compression and encryption)</td>
</tr>
<tr>
<td></td>
<td class="nw">rsync -auz -e ssh remote:/dir/ <strong>.</strong> &amp;&amp; rsync -auz -e ssh <strong>.</strong> remote:/dir/</td>
<td>Synchronize current directory with remote one</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>ssh</strong> (Secure SHell)</td>
</tr>
<tr>
<td></td>
<td class="nw">ssh $USER@$HOST command</td>
<td>Run command on $HOST as $USER (default command=shell)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">ssh -f -Y $USER@$HOSTNAME xeyes</td>
<td>Run GUI command on $HOSTNAME as $USER</td>
</tr>
<tr>
<td></td>
<td class="nw">scp -p -r $USER@$HOST: file dir/</td>
<td>Copy with permissions to $USER&#8217;s home directory on $HOST</td>
</tr>
<tr>
<td></td>
<td class="nw">scp -c arcfour $USER@$LANHOST: bigfile</td>
<td>Use faster crypto for local LAN. This might saturate GigE</td>
</tr>
<tr>
<td></td>
<td class="nw">ssh -g -L 8080:localhost:80 root@$HOST</td>
<td>Forward connections to $HOSTNAME:8080 out to $HOST:80</td>
</tr>
<tr>
<td></td>
<td class="nw">ssh -R 1434:imap:143 root@$HOST</td>
<td>Forward connections from $HOST:1434 in to imap:143</td>
</tr>
<tr>
<td></td>
<td class="nw">ssh-copy-id $USER@$HOST</td>
<td>Install public key for $USER@$HOST for password-less log in</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>wget</strong> (multi purpose download tool)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">(cd dir/ &amp;&amp; wget -nd -pHEKk http://www.pixelbeat.org/cmdline.html)</td>
<td>Store local browsable version of a page to the current dir</td>
</tr>
<tr>
<td></td>
<td class="nw">wget -c http://www.example.com/large.file</td>
<td>Continue downloading a partially downloaded file</td>
</tr>
<tr>
<td></td>
<td class="nw">wget -r -nd -np -l1 -A &#8216;*.jpg&#8217; http://www.example.com/dir/</td>
<td>Download a set of files to the current directory</td>
</tr>
<tr>
<td></td>
<td class="nw">wget ftp://remote/file[1-9].iso/</td>
<td>FTP supports globbing directly</td>
</tr>
<tr>
<td>•</td>
<td class="nw">wget -q -O- http://www.pixelbeat.org/timeline.html | grep &#8216;a href&#8217; | head</td>
<td>Process output directly</td>
</tr>
<tr>
<td></td>
<td class="nw">echo &#8216;wget url&#8217; | at 01:00</td>
<td>Download url at 1AM to current dir</td>
</tr>
<tr>
<td></td>
<td class="nw">wget &#8211;limit-rate=20k url</td>
<td>Do a low priority download (limit to 20<a href="http://www.pixelbeat.org/speeds.html">KB/s</a> in this case)</td>
</tr>
<tr>
<td></td>
<td class="nw">wget -nv &#8211;spider &#8211;force-html -i bookmarks.html</td>
<td>Check links in a file</td>
</tr>
<tr>
<td></td>
<td class="nw">wget &#8211;mirror http://www.example.com/</td>
<td>Efficiently update a local copy of a site (handy from cron)</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>networking</strong> (Note ifconfig, route, mii-tool, nslookup commands are obsolete)</td>
</tr>
<tr>
<td></td>
<td class="nw"><acronym title="usually in /sbin/">ethtool</acronym> eth0</td>
<td>Show status of ethernet interface eth0</td>
</tr>
<tr>
<td></td>
<td class="nw">ethtool &#8211;change eth0 autoneg off speed 100 duplex full</td>
<td>Manually set ethernet interface speed</td>
</tr>
<tr>
<td></td>
<td class="nw"><acronym title="usually in /sbin/">iwconfig</acronym> eth1</td>
<td>Show status of wireless interface eth1</td>
</tr>
<tr>
<td></td>
<td class="nw">iwconfig eth1 rate 1Mb/s fixed</td>
<td>Manually set wireless interface speed</td>
</tr>
<tr>
<td>•</td>
<td class="nw"><acronym title="usually in /sbin/">iwlist</acronym> scan</td>
<td>List wireless networks in range</td>
</tr>
<tr>
<td>•</td>
<td class="nw"><acronym title="usually in /sbin/">ip</acronym> link show</td>
<td>List network interfaces</td>
</tr>
<tr>
<td></td>
<td class="nw">ip link set dev eth0 name wan</td>
<td>Rename interface eth0 to wan</td>
</tr>
<tr>
<td></td>
<td class="nw">ip link set dev eth0 up</td>
<td>Bring interface eth0 up (or down)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">ip addr show</td>
<td>List addresses for interfaces</td>
</tr>
<tr>
<td></td>
<td class="nw">ip addr add 1.2.3.4/24 brd + dev eth0</td>
<td>Add (or del) ip and mask (255.255.255.0)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">ip route show</td>
<td>List routing table</td>
</tr>
<tr>
<td></td>
<td class="nw">ip route add default via 1.2.3.254</td>
<td>Set default gateway to 1.2.3.254</td>
</tr>
<tr>
<td>•</td>
<td class="nw">host pixelbeat.org</td>
<td>Lookup DNS ip address for name or vice versa</td>
</tr>
<tr>
<td>•</td>
<td class="nw">hostname -i</td>
<td>Lookup local ip address (equivalent to host `hostname`)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">whois pixelbeat.org</td>
<td>Lookup whois info for hostname or ip address</td>
</tr>
<tr>
<td>•</td>
<td class="nw">netstat -tupl</td>
<td>List internet services on a system</td>
</tr>
<tr>
<td>•</td>
<td class="nw">netstat -tup</td>
<td>List active connections to/from system</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>windows networking</strong> (Note samba is the package that provides all this windows specific networking support)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">smbtree</td>
<td>Find windows machines. See also findsmb</td>
</tr>
<tr>
<td></td>
<td class="nw">nmblookup -A 1.2.3.4</td>
<td>Find the windows (netbios) name associated with ip address</td>
</tr>
<tr>
<td></td>
<td class="nw">smbclient -L windows_box</td>
<td>List shares on windows machine or samba server</td>
</tr>
<tr>
<td></td>
<td class="nw">mount -t smbfs -o fmask=666,guest //windows_box/share /mnt/share</td>
<td>Mount a windows share</td>
</tr>
<tr>
<td></td>
<td class="nw">echo &#8216;message&#8217; | smbclient -M windows_box</td>
<td>Send popup to windows machine (off by default in XP sp2)</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>text manipulation</strong> (Note sed uses stdin and stdout. Newer versions support inplace editing with the -i option)</td>
</tr>
<tr>
<td></td>
<td class="nw">sed &#8216;s/string1/string2/g&#8217;</td>
<td>Replace string1 with string2</td>
</tr>
<tr>
<td></td>
<td class="nw">sed &#8216;s/\(.*\)1/\12/g&#8217;</td>
<td>Modify anystring1 to anystring2</td>
</tr>
<tr>
<td></td>
<td class="nw">sed &#8216;/ *#/d; /^ *$/d&#8217;</td>
<td>Remove comments and blank lines</td>
</tr>
<tr>
<td></td>
<td class="nw">sed &#8216;:a; /\\$/N; s/\\\n//; ta&#8217;</td>
<td>Concatenate lines with trailing \</td>
</tr>
<tr>
<td></td>
<td class="nw">sed &#8216;s/[ \t]*$//&#8217;</td>
<td>Remove trailing spaces from lines</td>
</tr>
<tr>
<td></td>
<td class="nw">sed &#8216;s/\([`"$\]\)/\\\1/g&#8217;</td>
<td>Escape shell metacharacters active within double quotes</td>
</tr>
<tr>
<td>•</td>
<td class="nw">seq 10 | sed &#8220;s/^/      /; s/ *\(.\{7,\}\)/\1/&#8221;</td>
<td>Right align numbers</td>
</tr>
<tr>
<td></td>
<td class="nw">sed -n &#8217;1000{p;<acronym title="quit ASAP">q</acronym>}&#8217;</td>
<td>Print 1000th line</td>
</tr>
<tr>
<td></td>
<td class="nw">sed -n &#8217;10,20p;<acronym title="quit ASAP">20q</acronym>&#8216;</td>
<td>Print lines 10 to 20</td>
</tr>
<tr>
<td></td>
<td class="nw">sed -n &#8216;s/.*&lt;title&gt;\(.*\)&lt;\/title&gt;.*/\1/ip;<acronym title="quit after match">T;q</acronym>&#8216;</td>
<td>Extract title from HTML web page</td>
</tr>
<tr>
<td></td>
<td class="nw">sed -i 42d ~/.ssh/known_hosts</td>
<td>Delete a particular line</td>
</tr>
<tr>
<td></td>
<td class="nw">sort -t. -k1,1n -k2,2n -k3,3n -k4,4n</td>
<td>Sort IPV4 ip addresses</td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo &#8216;Test&#8217; | tr &#8216;[:lower:]&#8216; &#8216;[:upper:]&#8216;</td>
<td>Case conversion</td>
</tr>
<tr>
<td>•</td>
<td class="nw">tr -dc &#8216;[:print:]&#8216; &lt; /dev/urandom</td>
<td>Filter non printable characters</td>
</tr>
<tr>
<td>•</td>
<td class="nw">tr -s &#8216;[:blank:]&#8216; &#8216;\t&#8217; &lt;/proc/diskstats | cut -f4</td>
<td>cut fields separated by blanks</td>
</tr>
<tr>
<td>•</td>
<td class="nw">history | wc -l</td>
<td>Count lines</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>set operations</strong> (Note you can <a href="http://www.pixelbeat.org/docs/env.html">export LANG=C</a> for speed. Also these assume no duplicate lines within a file)</td>
</tr>
<tr>
<td></td>
<td class="nw">sort file1 file2 | uniq</td>
<td><acronym title="Items in either file1 or file2">Union</acronym> of unsorted files</td>
</tr>
<tr>
<td></td>
<td class="nw">sort file1 file2 | uniq -d</td>
<td><acronym title="Items both in file1 and file2">Intersection</acronym> of unsorted files</td>
</tr>
<tr>
<td></td>
<td class="nw">sort file1 file1 file2 | uniq -u</td>
<td><acronym title="Items in file2 not in file1">Difference</acronym> of unsorted files</td>
</tr>
<tr>
<td></td>
<td class="nw">sort file1 file2 | uniq -u</td>
<td><acronym title="Items in only one file">Symmetric Difference</acronym> of unsorted files</td>
</tr>
<tr>
<td></td>
<td class="nw">join <acronym title="process whole line (assuming no NUL characters present)">-t&#8221;</acronym> -a1 -a2 file1 file2</td>
<td>Union of sorted files</td>
</tr>
<tr>
<td></td>
<td class="nw">join -t&#8221; file1 file2</td>
<td>Intersection of sorted files</td>
</tr>
<tr>
<td></td>
<td class="nw">join -t&#8221; -v2 file1 file2</td>
<td>Difference of sorted files</td>
</tr>
<tr>
<td></td>
<td class="nw">join -t&#8221; -v1 -v2 file1 file2</td>
<td>Symmetric Difference of sorted files</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>math</strong></td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo &#8216;(1 + sqrt(5))/2&#8242; | bc -l</td>
<td>Quick math (Calculate φ). See also <a href="http://www.pixelbeat.org/scripts/bc">bc</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">seq -f &#8217;4/%g&#8217; 1 2 99999 | paste -sd-+ | bc -l</td>
<td>Calculate <span style="font-family:times;">π</span> the unix way</td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo &#8216;pad=20; min=64; (100*10^6)/((pad+min)*8)&#8217; | bc</td>
<td>More complex (int) e.g. This shows max FastE packet rate</td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo &#8216;pad=20; min=64; print (100E6)/((pad+min)*8)&#8217; | python</td>
<td>Python handles scientific notation</td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo &#8216;pad=20; plot [64:1518] (100*10**6)/((pad+x)*8)&#8217; | gnuplot -persist</td>
<td>Plot FastE packet rate vs packet size</td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo &#8216;obase=16; ibase=10; 64206&#8242; | bc</td>
<td>Base conversion (decimal to hexadecimal)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo $((0x2dec))</td>
<td>Base conversion (hex to dec) ((shell arithmetic expansion))</td>
</tr>
<tr>
<td>•</td>
<td class="nw">units -t &#8217;100m/<a href="http://www.pixelbeat.org/misc/usain_bolt/">9.58s</a>&#8216; &#8216;miles/hour&#8217;</td>
<td>Unit conversion (metric to imperial)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">units -t &#8217;500GB&#8217; &#8216;GiB&#8217;</td>
<td>Unit conversion (<acronym title="powers of 10">SI</acronym> to <acronym title="powers of 2">IEC</acronym> prefixes)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">units -t &#8217;1 googol&#8217;</td>
<td>Definition lookup</td>
</tr>
<tr>
<td>•</td>
<td class="nw">seq 100 | (tr &#8216;\n&#8217; +; echo 0) | bc</td>
<td>Add a column of numbers. See also <a href="http://www.pixelbeat.org/scripts/add">add</a> and <a href="http://www.pixelbeat.org/scripts/funcpy">funcpy</a></td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>calendar</strong></td>
</tr>
<tr>
<td>•</td>
<td class="nw">cal -3</td>
<td>Display a calendar</td>
</tr>
<tr>
<td>•</td>
<td class="nw">cal 9 1752</td>
<td>Display a calendar for a particular month year</td>
</tr>
<tr>
<td>•</td>
<td class="nw">date -d fri</td>
<td>What date is it this friday. See also <a href="http://www.pixelbeat.org/scripts/day">day</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">[ $(date -d '12:00 +1 day' +%d) = '01' ] || exit</td>
<td>exit a script unless it&#8217;s the last day of the month</td>
</tr>
<tr>
<td>•</td>
<td class="nw">date &#8211;date=&#8217;25 Dec&#8217; +%A</td>
<td>What day does xmas fall on, this year</td>
</tr>
<tr>
<td>•</td>
<td class="nw">date &#8211;date=&#8217;@2147483647&#8242;</td>
<td>Convert seconds since the epoch (1970-01-01 UTC) to date</td>
</tr>
<tr>
<td>•</td>
<td class="nw">TZ=&#8217;America/Los_Angeles&#8217; date</td>
<td>What time is it on west coast of US (use tzselect to find TZ)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">date &#8211;date=&#8217;TZ=&#8221;America/Los_Angeles&#8221; 09:00 next Fri&#8217;</td>
<td>What&#8217;s the local time for 9AM next Friday on west coast US</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>locales</strong></td>
</tr>
<tr>
<td>•</td>
<td class="nw">printf &#8220;%&#8217;d\n&#8221; 1234</td>
<td>Print number with thousands grouping appropriate to locale</td>
</tr>
<tr>
<td>•</td>
<td class="nw">BLOCK_SIZE=\&#8217;1 ls -l</td>
<td>Use locale thousands grouping in ls. See also <a href="http://www.pixelbeat.org/scripts/l">l</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo &#8220;I live in `locale territory`&#8221;</td>
<td>Extract info from locale database</td>
</tr>
<tr>
<td>•</td>
<td class="nw">LANG=en_IE.utf8 locale int_prefix</td>
<td>Lookup locale info for specific country. See also <a href="http://www.pixelbeat.org/scripts/ccodes">ccodes</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">locale -kc $(locale | sed -n &#8216;s/\(LC_.\{4,\}\)=.*/\1/p&#8217;) | less</td>
<td>List fields available in locale database</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>recode</strong> (Obsoletes iconv, dos2unix, unix2dos)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">recode -l | less</td>
<td>Show available conversions (aliases on each line)</td>
</tr>
<tr>
<td></td>
<td class="nw">recode windows-1252.. file_to_change.txt</td>
<td>Windows &#8220;ansi&#8221; to local charset (auto does CRLF conversion)</td>
</tr>
<tr>
<td></td>
<td class="nw">recode utf-8/CRLF.. file_to_change.txt</td>
<td>Windows utf8 to local charset</td>
</tr>
<tr>
<td></td>
<td class="nw">recode iso-8859-15..utf8 file_to_change.txt</td>
<td>Latin9 (western europe) to utf8</td>
</tr>
<tr>
<td></td>
<td class="nw">recode ../b64 &lt; file.txt &gt; file.b64</td>
<td>Base64 encode</td>
</tr>
<tr>
<td></td>
<td class="nw">recode /qp.. &lt; file.qp &gt; file.txt</td>
<td>Quoted printable decode</td>
</tr>
<tr>
<td></td>
<td class="nw">recode ..HTML &lt; file.txt &gt; file.html</td>
<td>Text to HTML</td>
</tr>
<tr>
<td>•</td>
<td class="nw">recode -lf windows-1252 | grep euro</td>
<td>Lookup <a href="http://www.pixelbeat.org/docs/utf8.html">table of characters</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo -n 0&#215;80 | recode latin-9/x1..dump</td>
<td>Show what a code represents in latin-9 charmap</td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo -n 0x20AC | recode ucs-2/x2..latin-9/x</td>
<td>Show latin-9 encoding</td>
</tr>
<tr>
<td>•</td>
<td class="nw">echo -n 0x20AC | recode ucs-2/x2..utf-8/x</td>
<td>Show utf-8 encoding</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong><acronym title="Compact Disks">CDs</acronym></strong></td>
</tr>
<tr>
<td></td>
<td class="nw">gzip &lt; /dev/cdrom &gt; cdrom.iso.gz</td>
<td>Save copy of data cdrom</td>
</tr>
<tr>
<td></td>
<td class="nw">mkisofs -V LABEL -r dir | gzip &gt; cdrom.iso.gz</td>
<td>Create cdrom image from contents of dir</td>
</tr>
<tr>
<td></td>
<td class="nw">mount -o loop cdrom.iso /mnt/dir</td>
<td>Mount the cdrom image at /mnt/dir (read only)</td>
</tr>
<tr>
<td></td>
<td class="nw">cdrecord -v dev=/dev/cdrom blank=fast</td>
<td>Clear a CDRW</td>
</tr>
<tr>
<td></td>
<td class="nw">gzip -dc cdrom.iso.gz | cdrecord -v dev=/dev/cdrom -</td>
<td>Burn cdrom image (use dev=ATAPI -scanbus to confirm dev)</td>
</tr>
<tr>
<td></td>
<td class="nw">cdparanoia -B</td>
<td>Rip audio tracks from CD to wav files in current dir</td>
</tr>
<tr>
<td></td>
<td class="nw">cdrecord -v dev=/dev/cdrom -audio -pad *.wav</td>
<td>Make audio CD from all wavs in current dir (see also cdrdao)</td>
</tr>
<tr>
<td></td>
<td class="nw">oggenc &#8211;tracknum=&#8217;track&#8217; track.cdda.wav -o &#8216;track.ogg&#8217;</td>
<td>Make ogg file from wav file</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>disk space</strong> (See also <a href="http://www.pixelbeat.org/fslint/">FSlint</a>)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">ls -lSr</td>
<td>Show files by size, biggest last</td>
</tr>
<tr>
<td>•</td>
<td class="nw">du -s * | sort -k1,1rn | head</td>
<td>Show top disk users in current dir. See also <a href="http://www.pixelbeat.org/scripts/dutop">dutop</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">du -hs /home/* | sort -k1,1<acronym title="available since coreutils 7.5">h</acronym></td>
<td>Sort paths by easy to interpret disk usage</td>
</tr>
<tr>
<td>•</td>
<td class="nw">df -h</td>
<td>Show free space on mounted filesystems</td>
</tr>
<tr>
<td>•</td>
<td class="nw">df -i</td>
<td>Show free inodes on mounted filesystems</td>
</tr>
<tr>
<td>•</td>
<td class="nw"><acronym title="usually in /sbin/">fdisk</acronym> -l</td>
<td>Show disks partitions sizes and types (run as root)</td>
</tr>
<tr>
<td>•</td>
<td class="nw"><a href="http://www.pixelbeat.org/docs/packaging.html">rpm</a> -q -a &#8211;qf &#8216;%10{SIZE}\t%{NAME}\n&#8217; | sort -k1,1n</td>
<td>List all <a href="http://www.pixelbeat.org/docs/packaging.html">packages</a> by installed size (Bytes) on rpm distros</td>
</tr>
<tr>
<td>•</td>
<td class="nw"><a href="http://www.pixelbeat.org/docs/packaging.html">dpkg</a>-query -W -f=&#8217;${Installed-Size;10}\t${Package}\n&#8217; | sort -k1,1n</td>
<td>List all <a href="http://www.pixelbeat.org/docs/packaging.html">packages</a> by installed size (KBytes) on deb distros</td>
</tr>
<tr>
<td>•</td>
<td class="nw">dd bs=1 seek=2TB if=/dev/null of=ext3.test</td>
<td>Create a large test file (taking no space). See also <a href="http://www.pixelbeat.org/scripts/truncate">truncate</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">&gt; file</td>
<td>truncate data of file or create an empty file</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>monitoring/debugging</strong></td>
</tr>
<tr>
<td>•</td>
<td class="nw">tail -f /var/log/messages</td>
<td><a href="http://www.pixelbeat.org/docs/web/access_log/monitoring.html">Monitor messages</a> in a log file</td>
</tr>
<tr>
<td>•</td>
<td class="nw">strace -c ls &gt;/dev/null</td>
<td>Summarise/profile system calls made by command</td>
</tr>
<tr>
<td>•</td>
<td class="nw">strace -f -e open ls &gt;/dev/null</td>
<td>List system calls made by command</td>
</tr>
<tr>
<td>•</td>
<td class="nw">strace -f -e trace=write -e write=1,2 ls &gt;/dev/null</td>
<td>Monitor what&#8217;s written to stdout and stderr</td>
</tr>
<tr>
<td>•</td>
<td class="nw">ltrace -f -e getenv ls &gt;/dev/null</td>
<td>List library calls made by command</td>
</tr>
<tr>
<td>•</td>
<td class="nw"><acronym title="usually in /usr/sbin/">lsof</acronym> -p <acronym title="process id of current shell">$$</acronym></td>
<td>List paths that process id has open</td>
</tr>
<tr>
<td>•</td>
<td class="nw">lsof ~</td>
<td>List processes that have specified path open</td>
</tr>
<tr>
<td>•</td>
<td class="nw">tcpdump not port 22</td>
<td>Show network traffic except ssh. See also <a href="http://www.pixelbeat.org/scripts/tcpdump_not_me">tcpdump_not_me</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">ps -e -o pid,args &#8211;forest</td>
<td>List processes in a hierarchy</td>
</tr>
<tr>
<td>•</td>
<td class="nw">ps -e -o pcpu,cpu,nice,state,cputime,args &#8211;sort pcpu | sed &#8216;/^ 0.0 /d&#8217;</td>
<td>List processes by % cpu usage</td>
</tr>
<tr>
<td>•</td>
<td class="nw">ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS</td>
<td>List processes by mem (KB) usage. See also <a href="http://www.pixelbeat.org/scripts/ps_mem.py">ps_mem.py</a></td>
</tr>
<tr>
<td>•</td>
<td class="nw">ps -C firefox-bin -L -o pid,tid,pcpu,state</td>
<td>List all threads for a particular process</td>
</tr>
<tr>
<td>•</td>
<td class="nw">ps -p 1,$$ -o etime=</td>
<td>List elapsed wall time for particular process IDs</td>
</tr>
<tr>
<td>•</td>
<td class="nw">last reboot</td>
<td>Show system reboot history</td>
</tr>
<tr>
<td>•</td>
<td class="nw">free -m</td>
<td>Show amount of (remaining) RAM (-m displays in MB)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">watch -n.1 &#8216;cat /proc/interrupts&#8217;</td>
<td>Watch changeable data continuously</td>
</tr>
<tr>
<td>•</td>
<td class="nw">udevadm monitor</td>
<td>Monitor udev events to help configure rules</td>
</tr>
<tr class="pbtitle">
<td colspan="3"><strong>system information</strong> (see also <a href="http://www.pixelbeat.org/scripts/sysinfo">sysinfo</a>) (&#8216;#&#8217; means root access is required)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">uname -a</td>
<td>Show kernel version and system architecture</td>
</tr>
<tr>
<td>•</td>
<td class="nw">head -n1 /etc/issue</td>
<td>Show name and version of distribution</td>
</tr>
<tr>
<td>•</td>
<td class="nw">cat /proc/partitions</td>
<td>Show all partitions registered on the system</td>
</tr>
<tr>
<td>•</td>
<td class="nw">grep MemTotal /proc/meminfo</td>
<td>Show RAM total seen by the system</td>
</tr>
<tr>
<td>•</td>
<td class="nw">grep &#8220;model name&#8221; /proc/cpuinfo</td>
<td>Show CPU(s) info</td>
</tr>
<tr>
<td>•</td>
<td class="nw"><acronym title="usually in /sbin/">lspci</acronym> -tv</td>
<td>Show PCI info</td>
</tr>
<tr>
<td>•</td>
<td class="nw"><acronym title="usually in /sbin/">lsusb</acronym> -tv</td>
<td>Show USB info</td>
</tr>
<tr>
<td>•</td>
<td class="nw">mount | column -t</td>
<td>List mounted filesystems on the system (and align output)</td>
</tr>
<tr>
<td>•</td>
<td class="nw">grep -F capacity: /proc/acpi/battery/BAT0/info</td>
<td>Show state of cells in laptop battery</td>
</tr>
<tr>
<td>#</td>
<td class="nw">dmidecode -q | less</td>
<td>Display SMBIOS/DMI information</td>
</tr>
<tr>
<td>#</td>
<td class="nw">smartctl -A /dev/sda | grep Power_On_Hours</td>
<td>How long has this disk (system) been powered on in total</td>
</tr>
<tr>
<td>#</td>
<td class="nw">hdparm -i /dev/sda</td>
<td>Show info about disk sda</td>
</tr>
<tr>
<td>#</td>
<td class="nw">hdparm -tT /dev/sda</td>
<td>Do a read speed test on disk sda</td>
</tr>
<tr>
<td>#</td>
<td class="nw">badblocks -s /dev/sda</td>
<td>Test for unreadable blocks on disk sda</td>
</tr>
</tbody>
</table>
<pre><a name="Directories"></a>

<strong><span style="text-decoration:underline;">Listing some contents with examples:</span></strong> 

<span style="text-decoration:underline;"><strong>Listing directory contents:</strong></span> 

ls    list a directory
ls -l    list a directory in long ( detailed ) format

   for example:
$ ls -l
drwxr-xr-x    4 cliff    user        1024 Jun 18 09:40 WAITRON_EARNINGS
-rw-r--r--    1 cliff    user      767392 Jun  6 14:28 scanlib.tar.gz
^ ^  ^  ^     ^   ^       ^           ^      ^    ^      ^
| |  |  |     |   |       |           |      |    |      |
| |  |  |     | owner   group       size   date  time    name
| |  |  |     number of links to file or directory contents
| |  |  permissions for world
| |  permissions for members of group
| permissions for owner of file: r = read, w = write, x = execute -=no permission
type of file: - = normal file, d=directory, l = symbolic link, and others...

ls -a        List the current directory including hidden files. Hidden files start
             with "."
ls -ld *     List all the file and directory names in the current directory using
             long format. Without the "d" option, ls would list the contents
             of any sub-directory of the current. With the "d" option, ls
             just lists them like regular files. 

<strong><span style="text-decoration:underline;">Changing file permissions and attributes</span></strong> 

chmod 755 file       Changes the permissions of file to be rwx for the owner, and rx for
                     the group and the world. (7 = rwx = 111 binary. 5 = r-x = 101 binary)
chgrp user file      Makes file belong to the group user.
chown cliff file     Makes cliff the owner of file.
chown -R cliff dir   Makes cliff the owner of dir and everything in its directory tree. 

You must be the owner of the file/directory or be root before you can do any of these things. 

<strong><span style="text-decoration:underline;">Viewing and editing files:</span></strong> 

cat filename      Dump a file to the screen in ascii.
more filename     Progressively dump a file to the screen: ENTER = one line down
                  SPACEBAR = page down  q=quit
less filename     Like more, but you can use Page-Up too. Not on all systems.
vi filename       Edit a file using the vi editor. All UNIX systems will have vi in some form.
emacs filename    Edit a file using the emacs editor. Not all systems will have emacs.
head filename     Show the first few lines of a file.
head -n  filename Show the first n lines of a file.
tail filename     Show the last few lines of a file.
tail -n filename  Show the last n lines of a file.

<strong></strong><strong><span style="text-decoration:underline;">Environment variables</span></strong> 

You can teach your shell to remember things for later using environment variables.
For example under the bash shell:

export CASROOT=/usr/local/CAS3.0               Defines the variable CASROOT with the value
                                               /usr/local/CAS3.0.
export LD_LIBRARY_PATH=$CASROOT/Linux/lib      Defines the variable LD_LIBRARY_PATH with
                                               the value of CASROOT with /Linux/lib appended,
                                               or /usr/local/CAS3.0/Linux/lib 

By prefixing $ to the variable name, you can evaluate it in any command:

cd $CASROOT         Changes your present working directory to the value of CASROOT

echo $CASROOT       Prints out the value of CASROOT, or /usr/local/CAS3.0
printenv CASROOT    Does the same thing in bash and some other shells. 

<strong><span style="text-decoration:underline;">Pipes:</span></strong> 

The pipe symbol "|" is used to direct the output of one command to the input
of another.

For example:

ls -l | more   This commands takes the output of the long format directory list command
               "ls -l" and pipes it through the more command (also known as a filter).
               In this case a very long list of files can be viewed a page at a time.

du -sc * | sort -n | tail
               The command "du -sc" lists the sizes of all files and directories in the
               current working directory. That is piped through "sort -n" which orders the
               output from smallest to largest size. Finally, that output is piped through "tail"
               which displays only the last few (which just happen to be the largest) results.
<a name="CommandSubst"></a> 

<a name="Vi"></a></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/neeocis.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/neeocis.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/neeocis.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/neeocis.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/neeocis.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/neeocis.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/neeocis.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/neeocis.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/neeocis.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/neeocis.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/neeocis.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/neeocis.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/neeocis.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/neeocis.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=298&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://neeocis.wordpress.com/2011/06/21/unixlinux-commands-for-everyday-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5bfefeca90549cba372124e62d71c4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">neeocis</media:title>
		</media:content>
	</item>
		<item>
		<title>2010 in review</title>
		<link>http://neeocis.wordpress.com/2011/01/02/2010-in-review/</link>
		<comments>http://neeocis.wordpress.com/2011/01/02/2010-in-review/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 09:43:17 +0000</pubDate>
		<dc:creator>Tanveer</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Hear I am]]></category>
		<category><![CDATA[Idea]]></category>

		<guid isPermaLink="false">http://neeocis.wordpress.com/?p=291</guid>
		<description><![CDATA[The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here&#8217;s a high level summary of its overall blog health: The Blog-Health-o-Meter&#8482; reads Wow. Crunchy numbers The average container ship can carry about 4,500 containers. This blog was viewed about 16,000 times in 2010. If each view were a shipping [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=291&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[
<p>The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here&#8217;s a high level summary of its overall blog health:</p>
<p align="center"><img style="border:1px solid #ddd;background:#f5f5f5;padding:20px;" src="http://s0.wp.com/i/annual-recap/meter-healthy5.gif" width="250" height="183" alt="Healthy blog!"></p>
<p align="center">The <em>Blog-Health-o-Meter&trade;</em> reads Wow.</p>
<h2>Crunchy numbers</h2>
<p>			<a href="http://neeocis.files.wordpress.com/2010/06/openiddiagram.png"><img src="http://neeocis.files.wordpress.com/2010/06/openiddiagram.png?w=288" alt="Featured image" style="max-height:230px;float:right;border:1px solid #ddd;background:#fff;margin:0 0 1em 1em;padding:6px;" /></a></p>
<p>The average container ship can carry about 4,500 containers.  This blog was viewed about <strong>16,000</strong> times in 2010.  If each view were a shipping container, your blog would have filled about 4 fully loaded ships.</p>
<p>
<p>In 2010, there were <strong>12</strong> new posts, growing the total archive of this blog to 67 posts. There were <strong>4</strong> pictures uploaded, taking up a total of 122kb. </p>
<p>The busiest day of the year was October 27th with <strong>95</strong> views. The most popular post that day was <a style="color:#08c;" href="http://neeocis.wordpress.com/2008/07/08/crontab-every-five-minutes/">[Linux] Crontab every five minutes</a>.</p>
<p></p>
<h2>Where did they come from?</h2>
<p>The top referring sites in 2010 were <strong>embraceubuntu.com</strong>, <strong>google.co.in</strong>, <strong>social.msdn.microsoft.com</strong>, <strong>google.com</strong>, and <strong>tanveer.awardspace.com</strong>.</p>
<p>Some visitors came searching, mostly for <strong>crontab every 5 minutes</strong>, <strong>cron every 5 minutes</strong>, <strong>cakephp https</strong>, <strong>cakephp paypal</strong>, and <strong>cakephp ssl</strong>.</p>
<div style="clear:both;"></div>
<h2>Attractions in 2010</h2>
<p>These are the posts and pages that got the most views in 2010.</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">1</div>
<p>					<a style="margin-right:10px;" href="http://neeocis.wordpress.com/2008/07/08/crontab-every-five-minutes/">[Linux] Crontab every five minutes</a> <span style="color:#999;font-size:8pt;">July 2008</span><br />7 comments											</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">2</div>
<p>					<a style="margin-right:10px;" href="http://neeocis.wordpress.com/2008/07/09/cakephp-creating-a-route-usage-https-ssl-connection/">CakePHP: Creating a route usage https (SSL connection)</a> <span style="color:#999;font-size:8pt;">July 2008</span><br />24 comments and 1 Like on WordPress.com,											</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">3</div>
<p>					<a style="margin-right:10px;" href="http://neeocis.wordpress.com/2008/04/27/warning-rpmts_hdrfromfdno-header-v3-dsa-signature-nokey-key-id-d66b746e/">warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID d66b746e</a> <span style="color:#999;font-size:8pt;">April 2008</span><br />2 comments											</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">4</div>
<p>					<a style="margin-right:10px;" href="http://neeocis.wordpress.com/2010/01/06/cakephp-component-for-paypal-intergration-with-socket/">how to implement paypal in cakephp?</a> <span style="color:#999;font-size:8pt;">January 2010</span><br />2 comments											</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">5</div>
<p>					<a style="margin-right:10px;" href="http://neeocis.wordpress.com/2010/06/03/implementing-google-federated-login-using-hybrid-protocol-openidoauth/">Implementing Google federated login using Hybrid Protocol (OpenID+OAuth)</a> <span style="color:#999;font-size:8pt;">June 2010</span><br />4 comments and 2 Likes on WordPress.com											</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/neeocis.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/neeocis.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/neeocis.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/neeocis.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/neeocis.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/neeocis.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/neeocis.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/neeocis.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/neeocis.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/neeocis.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/neeocis.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/neeocis.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/neeocis.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/neeocis.wordpress.com/291/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=291&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://neeocis.wordpress.com/2011/01/02/2010-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5bfefeca90549cba372124e62d71c4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">neeocis</media:title>
		</media:content>

		<media:content url="http://s0.wp.com/i/annual-recap/meter-healthy5.gif" medium="image">
			<media:title type="html">Healthy blog!</media:title>
		</media:content>

		<media:content url="http://neeocis.files.wordpress.com/2010/06/openiddiagram.png?w=288" medium="image">
			<media:title type="html">Featured image</media:title>
		</media:content>
	</item>
		<item>
		<title>Pasteboard is a free and simple clipboard management tool</title>
		<link>http://neeocis.wordpress.com/2010/10/31/pasteboard-is-a-free-and-simple-clipboard-management-tool/</link>
		<comments>http://neeocis.wordpress.com/2010/10/31/pasteboard-is-a-free-and-simple-clipboard-management-tool/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 13:51:27 +0000</pubDate>
		<dc:creator>Tanveer</dc:creator>
		
		<guid isPermaLink="false">http://neeocis.wordpress.com/?p=285</guid>
		<description><![CDATA[There&#8217;s no dearth of clipboard management applications. These are usually tools that let you copy and paste multiple snippets of text, append text to your clipboard, or manage images and other rich content in all sorts of clever ways. Pasteboard doesn&#8217;t even try to compete with that sort of functionality. It&#8217;s a single-file application (if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=285&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.blogcdn.com/www.downloadsquad.com/media/2010/10/pasteboard-5243.jpg" alt="Pasteboard is free" /></p>
<p>There&#8217;s no dearth of clipboard management applications. These are usually tools that let you copy and paste multiple snippets of text, append text to your clipboard, or manage images and other rich content in all sorts of clever ways.</p>
<p><a href="http://cybia.co.uk/pasteboard.html">Pasteboard</a> doesn&#8217;t even try to compete with that sort of functionality. It&#8217;s a single-file application (if you don&#8217;t count the readme and the PDF manual) that is free, portable, and &#8212; at just 964KB of RAM on my system &#8212; very lightweight.</p>
<p>All it does is give you 10 text fields that you can copy and paste text into. When you close the application, the content of each field is automatically saved, and will show up the next time you run Pasteboard. It&#8217;s stored as plain text, too &#8212; so if you need to strip links or formatting off of text that you copied from a website, you can just paste it into Pasteboard.</p>
<p>This is nothing you couldn&#8217;t do with Stickies or with a ton of other applications, but Pasteboard is simple, lightweight, and it does what it says on the tin.</p>
<blockquote><p>
Source : <a href="http://www.downloadsquad.com/2010/10/29/pasteboard-is-a-free-and-simple-clipboard-management-tool/">DownloadSquad</a><br />
Provided By: <a href="http://tanveer.com.co.in">tanveer.com.co.in</a>
</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/neeocis.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/neeocis.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/neeocis.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/neeocis.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/neeocis.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/neeocis.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/neeocis.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/neeocis.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/neeocis.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/neeocis.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/neeocis.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/neeocis.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/neeocis.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/neeocis.wordpress.com/285/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=neeocis.wordpress.com&amp;blog=3004464&amp;post=285&amp;subd=neeocis&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://neeocis.wordpress.com/2010/10/31/pasteboard-is-a-free-and-simple-clipboard-management-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5bfefeca90549cba372124e62d71c4da?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">neeocis</media:title>
		</media:content>

		<media:content url="http://www.blogcdn.com/www.downloadsquad.com/media/2010/10/pasteboard-5243.jpg" medium="image">
			<media:title type="html">Pasteboard is free</media:title>
		</media:content>
	</item>
	</channel>
</rss>
