<?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>blog.watashii &#187; Unix</title>
	<atom:link href="http://blog.watashii.com/category/programming/unix-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.watashii.com</link>
	<description></description>
	<lastBuildDate>Wed, 02 Nov 2011 02:23:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Linux Installing and Uninstalling RPM Packages</title>
		<link>http://blog.watashii.com/2011/11/linux-installing-and-uninstalling-rpm-packages/</link>
		<comments>http://blog.watashii.com/2011/11/linux-installing-and-uninstalling-rpm-packages/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 02:22:04 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rpm]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=557</guid>
		<description><![CDATA[Installing a package on Linux:  (Eg, MQSeriesRuntime-7.0.1-3.x86_64.rpm) $ rpm -ivh MQSeriesRuntime-7.0.1-3.x86_64.rpm Verify the package installed:  (The architecture x86_64 name is not required) $ rpm -qa MQSeriesRuntime-7.0.1-3 Uninstall the package: $ rpm -e MQSeriesRuntime-7.0.1-3 Note: Sudo maybe required for install, in this case, run sudo rpm &#8230;]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-559 alignnone aligncenter" title="rpm-package" src="http://blog.watashii.com/wp-content/uploads/2011/11/rpm-package.png" alt="" width="180" height="179" /></p>
<p>Installing a package on Linux:  (Eg, MQSeriesRuntime-7.0.1-3.x86_64.rpm)</p>
<p><code>$ rpm -ivh MQSeriesRuntime-7.0.1-3.x86_64.rpm</code></p>
<p>Verify the package installed:  (The architecture x86_64 name is not required)</p>
<p><code>$ rpm -qa MQSeriesRuntime-7.0.1-3</code></p>
<p>Uninstall the package:</p>
<p><code>$ rpm -e MQSeriesRuntime-7.0.1-3</code></p>
<p>Note: Sudo maybe required for install, in this case, run <em>sudo rpm &#8230;</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2011/11/linux-installing-and-uninstalling-rpm-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle SQLPlus Query Output to a File</title>
		<link>http://blog.watashii.com/2011/02/oracle-sqlplus-query-output-to-a-file/</link>
		<comments>http://blog.watashii.com/2011/02/oracle-sqlplus-query-output-to-a-file/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 03:48:04 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlplus]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=548</guid>
		<description><![CDATA[Here is a simple way to output SQL query output into a file, via command line based SQLPlus. Step 1: Nominate the output file location. In this case this is a Unix location. SQL&#62; spool /tmp/output.txt Step 2: Perform your SQL query. SQL&#62; select * from tab; Step 3: Close the file. SQL&#62; spool off [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2010/11/starting-shutdown-oracle-database-in-unix/' rel='bookmark' title='Permanent Link: Starting / Shutdown Oracle Database in Unix'>Starting / Shutdown Oracle Database in Unix</a></li>
<li><a href='http://blog.watashii.com/2008/08/oracle-sql-loader-importing-csv-files-into-a-table/' rel='bookmark' title='Permanent Link: Oracle SQL Loader &#8211; Importing CSV files to a table'>Oracle SQL Loader &#8211; Importing CSV files to a table</a></li>
<li><a href='http://blog.watashii.com/2008/08/unix-file-size-listing-du-command/' rel='bookmark' title='Permanent Link: UNIX file size listing &#8211; du command'>UNIX file size listing &#8211; du command</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/11/oraclelogo.jpg"><img class="alignnone size-full wp-image-496" title="oraclelogo" src="http://blog.watashii.com/wp-content/uploads/2010/11/oraclelogo.jpg" alt="" width="220" height="100" /></a></p>
<p>Here is a simple way to output SQL query output into a file, via command line based SQLPlus.</p>
<h5><strong>Step 1:</strong> Nominate the output file location. In this case this is a Unix location.</h5>
<p><code>SQL&gt; spool /tmp/output.txt</code></p>
<h5><strong>Step 2:</strong> Perform your SQL query.</h5>
<p><code>SQL&gt; select * from tab;</code></p>
<h5><strong>Step 3:</strong> Close the file.</h5>
<p><code>SQL&gt; spool off</code></p>
<h5><strong>Tip:</strong> Use <strong><em>set lines</em></strong> statement to adjust output display</h5>
<p><span id="more-548"></span></p>
<p>The other method is doing this outside of SQLPlus in a single command.  Within the Unix shell, you can write your SQL query statements within an input sql file; eg <em>input.sql</em>, and redirect the output to <em>output.txt</em>.</p>
<p><code># sqlplus USER/PASS@DBSID &lt; /tmp/input.sql &gt; /tmp/output.txt</code></p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2010/11/starting-shutdown-oracle-database-in-unix/' rel='bookmark' title='Permanent Link: Starting / Shutdown Oracle Database in Unix'>Starting / Shutdown Oracle Database in Unix</a></li>
<li><a href='http://blog.watashii.com/2008/08/oracle-sql-loader-importing-csv-files-into-a-table/' rel='bookmark' title='Permanent Link: Oracle SQL Loader &#8211; Importing CSV files to a table'>Oracle SQL Loader &#8211; Importing CSV files to a table</a></li>
<li><a href='http://blog.watashii.com/2008/08/unix-file-size-listing-du-command/' rel='bookmark' title='Permanent Link: UNIX file size listing &#8211; du command'>UNIX file size listing &#8211; du command</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2011/02/oracle-sqlplus-query-output-to-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install &amp; Uninstall Probes/Gateways on Netcool Omnibus</title>
		<link>http://blog.watashii.com/2011/01/install-uninstall-probesgateways-on-netcool-omnibus/</link>
		<comments>http://blog.watashii.com/2011/01/install-uninstall-probesgateways-on-netcool-omnibus/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 05:56:06 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[netcool]]></category>
		<category><![CDATA[omnibus]]></category>
		<category><![CDATA[probes]]></category>
		<category><![CDATA[tivoli]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=516</guid>
		<description><![CDATA[Installing probes &#38; gateway for Netcool/Omnibus 7.2 and below (ie prior to 7.3) is done by using the nco_patch patch tool over an existing Netcool Omnibus installation, with the un-tarred path of the patch (Unix): $ $NCHOME/omnibus/install/nco_patch -install /tmp/probe-nco-p-mttrapd-9_0/patch/probe-nco-p-mttrapd-9_0/ To list all the patch (ids) that has been already applied to the installation, run the [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2008/07/netcoolomnibus-replay-raw-capture-alarms/' rel='bookmark' title='Permanent Link: Netcool/OMNIbus &#8211; Replay raw capture alarms'>Netcool/OMNIbus &#8211; Replay raw capture alarms</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://blog.watashii.com/wp-content/uploads/2011/01/IBM_Tivoli.gif"><img class="size-full wp-image-517 aligncenter" title="IBM_Tivoli" src="http://blog.watashii.com/wp-content/uploads/2011/01/IBM_Tivoli.gif" alt="" width="163" height="84" /></a></p>
<p>Installing probes &amp; gateway for Netcool/Omnibus 7.2 and below (ie prior to 7.3) is done by using the <em>nco_patch</em> patch tool over an existing Netcool Omnibus installation, with the un-tarred path of the patch (Unix):</p>
<p><code>$ $NCHOME/omnibus/install/nco_patch -install /tmp/probe-nco-p-mttrapd-9_0/patch/probe-nco-p-mttrapd-9_0/</code></p>
<p>To list all the patch (ids) that has been already applied to the installation, run the following command:</p>
<p><code>$ $NCHOME/omnibus/install/nco_patch -print=id<br />
gateway-nco-g-oracle-4_0<br />
gateway-nco-g-remedy-8_0<br />
probe-nco-p-mttrapd-9_0</code></p>
<p>To remove/uninstall the probe, we use the same <em>nco_patch</em> tool with the patch id :</p>
<p><code>$ $NCHOME/omnibus/install/nco_patch -remove probe-nco-p-mttrapd-9_0</code></p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2008/07/netcoolomnibus-replay-raw-capture-alarms/' rel='bookmark' title='Permanent Link: Netcool/OMNIbus &#8211; Replay raw capture alarms'>Netcool/OMNIbus &#8211; Replay raw capture alarms</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2011/01/install-uninstall-probesgateways-on-netcool-omnibus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting / Shutdown Oracle Database in Unix</title>
		<link>http://blog.watashii.com/2010/11/starting-shutdown-oracle-database-in-unix/</link>
		<comments>http://blog.watashii.com/2010/11/starting-shutdown-oracle-database-in-unix/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 02:40:42 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[shutdown]]></category>
		<category><![CDATA[startup]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=497</guid>
		<description><![CDATA[This simple guide to shows how to start /stop your Oracle database from Unix.  You must have logon access to do this. Step 1 Unix login as oracle (usually the user that installed the database) Step 2 Make sure your environment variables are set, eg: ORACLE_SID=MYDBSID ORACLE_BASE=/opt/oracle ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1 LD_LIBRARY_PATH=/opt/oracle/product/11.2.0/dbhome_1/lib PATH=/usr/bin:/usr/sbin:/usr/ucb:/usr/local:/usr/local/bin:/usr/local/sbin:/opt/oracle/product/11.2.0/dbhome_1/bin Step 3 &#8211; Start DB [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2009/11/oracle-timezone-conversions-gmt-to-localtime/' rel='bookmark' title='Permanent Link: Oracle Timezone Conversions &#8211; GMT to localtime (and back)'>Oracle Timezone Conversions &#8211; GMT to localtime (and back)</a></li>
<li><a href='http://blog.watashii.com/2008/08/oracle-sql-loader-importing-csv-files-into-a-table/' rel='bookmark' title='Permanent Link: Oracle SQL Loader &#8211; Importing CSV files to a table'>Oracle SQL Loader &#8211; Importing CSV files to a table</a></li>
<li><a href='http://blog.watashii.com/2011/02/oracle-sqlplus-query-output-to-a-file/' rel='bookmark' title='Permanent Link: Oracle SQLPlus Query Output to a File'>Oracle SQLPlus Query Output to a File</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/11/oraclelogo.jpg"><img class="alignnone size-full wp-image-496" title="oraclelogo" src="http://blog.watashii.com/wp-content/uploads/2010/11/oraclelogo.jpg" alt="" width="220" height="100" /></a></p>
<p>This simple guide to shows how to start /stop your Oracle database from Unix.  You must have logon access to do this.</p>
<h3>Step 1</h3>
<p>Unix login as <strong><em>oracle </em></strong>(usually the user that installed the database)</p>
<h3>Step 2</h3>
<p>Make sure your environment variables are set, eg:</p>
<pre><code>ORACLE_SID=<em>MYDBSID</em>
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1
LD_LIBRARY_PATH=/opt/oracle/product/11.2.0/dbhome_1/lib
PATH=/usr/bin:/usr/sbin:/usr/ucb:/usr/local:/usr/local/bin:/usr/local/sbin:/opt/oracle/product/11.2.0/dbhome_1/bin</code></pre>
<h3>Step 3 &#8211; Start DB Instance</h3>
<p>On the Unix command line, run <strong><em>sqlplus </em></strong>with <strong><em>sysdba</em></strong>, and simply type <strong><em>startup </em></strong>in the prompt to start it up.</p>
<pre><code>oracle@db-srv-01 % sqlplus '/ as sysdba'

SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 30 12:06:47 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL&gt; startup
ORACLE instance started.

Total System Global Area 3207790592 bytes
Fixed Size                  2152368 bytes
Variable Size            2449475664 bytes
Database Buffers          738197504 bytes
Redo Buffers               17965056 bytes
Database mounted.
Database opened.</code></pre>
<h3>Step 4 &#8211; Start Listener</h3>
<p>To start the oracle listener (assuming listener.ora is setup), run <strong><em>lsnrctl start</em></strong></p>
<pre><code>oracle@db-srv-01 % lsnrctl start

LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 30-NOV-2010 12:00:34

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /opt/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
System parameter file is /opt/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/db-srv-01/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db-srv-01)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db-srv-01)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
Start Date                30-NOV-2010 12:00:35
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/db-srv-01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db-srv-01)(PORT=1521)))
The listener supports no services
The command completed successfully</code></pre>
<h3>Step 4 &#8211; Shutdown</h3>
<p>Similarly, to shutdown the instance, type <strong><em>shudown normal</em></strong> within <strong><em>sqlplus</em></strong>.</p>
<p>Stop the listener, by running <strong><em>lsnrctl stop</em></strong></p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2009/11/oracle-timezone-conversions-gmt-to-localtime/' rel='bookmark' title='Permanent Link: Oracle Timezone Conversions &#8211; GMT to localtime (and back)'>Oracle Timezone Conversions &#8211; GMT to localtime (and back)</a></li>
<li><a href='http://blog.watashii.com/2008/08/oracle-sql-loader-importing-csv-files-into-a-table/' rel='bookmark' title='Permanent Link: Oracle SQL Loader &#8211; Importing CSV files to a table'>Oracle SQL Loader &#8211; Importing CSV files to a table</a></li>
<li><a href='http://blog.watashii.com/2011/02/oracle-sqlplus-query-output-to-a-file/' rel='bookmark' title='Permanent Link: Oracle SQLPlus Query Output to a File'>Oracle SQLPlus Query Output to a File</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/11/starting-shutdown-oracle-database-in-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix Bash Coloured Prompts</title>
		<link>http://blog.watashii.com/2010/09/unix-bash-coloured-prompts/</link>
		<comments>http://blog.watashii.com/2010/09/unix-bash-coloured-prompts/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 07:15:28 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[prompt]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=440</guid>
		<description><![CDATA[To display coloured prompts upon user login (on Unix Bash shell, PuTTY client), perform the following modifications: Unix login and open the user&#8217;s profile in the home directory, eg /home/username/.profile In the .profile, add the following entry in a new line to execute the bash shell upon login, eg /usr/bin/bash The bash shell will refer [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.watashii.com/wp-content/uploads/2010/09/bash_coloured_prompt.png"><img class="alignnone size-full wp-image-441" title="bash_coloured_prompt" src="http://blog.watashii.com/wp-content/uploads/2010/09/bash_coloured_prompt.png" alt="" /></a></p>
<p>To display coloured prompts upon user login (on Unix Bash shell, PuTTY client), perform the following modifications:</p>
<ol>
<li>Unix login and open the user&#8217;s profile in the home directory, eg <em>/home/username/.profile</em></li>
<li>In the <em>.profile</em>, add the following entry in a new line to execute the bash shell upon login, eg <em>/usr/bin/bash</em></li>
<li>The bash shell will refer to a <em>.bashrc</em> file.  If its not there, create it,  eg <em>/home/username/.bashrc</em></li>
<li>Add following entries in the <em>.bashrc</em> to enable the coloured prompt; showing the username, hostname and working directory:<br />
<code># Colored Prompts<br />
STARTGREEN='\[\e[0;32m\]';<br />
STARTBLUE='\[\e[1;34m\]';<br />
ENDCOLOR="\[\e[0m\]";<br />
PS1="$STARTGREEN\u@\h$ENDCOLOR:$STARTBLUE\w$ENDCOLOR $ ";</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/09/unix-bash-coloured-prompts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix Shell &#8211; Check If Directory Is Empty</title>
		<link>http://blog.watashii.com/2010/06/unix-shell-check-if-directory-is-empty/</link>
		<comments>http://blog.watashii.com/2010/06/unix-shell-check-if-directory-is-empty/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 09:22:27 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[empty]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=411</guid>
		<description><![CDATA[Here is a simple unix shell command to check if a directory, $dir, is empty. export $dir=/tmp/myfiles/ if [ "$(ls -A $dir)" ]; then echo "$dir NOT Empty"; else echo "$dir IS Empty"; fi Related Posts:UNIX file size listing &#8211; du command Unix LS Command With Colors&#8230; Without the &#8212;color Option Unix &#8211; Creating Cron [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2008/08/unix-file-size-listing-du-command/' rel='bookmark' title='Permanent Link: UNIX file size listing &#8211; du command'>UNIX file size listing &#8211; du command</a></li>
<li><a href='http://blog.watashii.com/2009/10/unix-ls-command-with-colors-without-the-color-option/' rel='bookmark' title='Permanent Link: Unix LS Command With Colors&#8230; Without the &#8212;color Option'>Unix LS Command With Colors&#8230; Without the &#8212;color Option</a></li>
<li><a href='http://blog.watashii.com/2008/07/unix-creating-chron-jobs-with-chrontab/' rel='bookmark' title='Permanent Link: Unix &#8211; Creating Cron Jobs with Crontab'>Unix &#8211; Creating Cron Jobs with Crontab</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://blog.watashii.com/wp-content/uploads/2010/06/code-icon.png"><img class="size-full wp-image-373 aligncenter" title="code-icon" src="http://blog.watashii.com/wp-content/uploads/2010/06/code-icon.png" alt="" width="150" height="150" /></a></p>
<p>Here is a simple unix shell command to check if a directory, <em>$dir</em>, is empty.</p>
<pre name="code" class="java">
export $dir=/tmp/myfiles/
if [ "$(ls -A $dir)" ];
then
    echo "$dir NOT Empty";
else
    echo "$dir IS Empty";
fi</pre>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2008/08/unix-file-size-listing-du-command/' rel='bookmark' title='Permanent Link: UNIX file size listing &#8211; du command'>UNIX file size listing &#8211; du command</a></li>
<li><a href='http://blog.watashii.com/2009/10/unix-ls-command-with-colors-without-the-color-option/' rel='bookmark' title='Permanent Link: Unix LS Command With Colors&#8230; Without the &#8212;color Option'>Unix LS Command With Colors&#8230; Without the &#8212;color Option</a></li>
<li><a href='http://blog.watashii.com/2008/07/unix-creating-chron-jobs-with-chrontab/' rel='bookmark' title='Permanent Link: Unix &#8211; Creating Cron Jobs with Crontab'>Unix &#8211; Creating Cron Jobs with Crontab</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2010/06/unix-shell-check-if-directory-is-empty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix LS Command With Colors&#8230; Without the &#8212;color Option</title>
		<link>http://blog.watashii.com/2009/10/unix-ls-command-with-colors-without-the-color-option/</link>
		<comments>http://blog.watashii.com/2009/10/unix-ls-command-with-colors-without-the-color-option/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 15:43:08 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[ls]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=262</guid>
		<description><![CDATA[Having command line text in colors makes things easier to read.  For example the ls command for listing directories and files.  In some Unix environments, the ls command may not support the &#8211;color option to let us do that (as it  requires GNU ls).  So how can we workaround this to add color to ls? [...]


Related Posts:<ol><li><a href='http://blog.watashii.com/2008/09/unix-ps-command-long-process-listing/' rel='bookmark' title='Permanent Link: Unix ps command &#8211; Long Process Listing'>Unix ps command &#8211; Long Process Listing</a></li>
<li><a href='http://blog.watashii.com/2008/08/unix-file-size-listing-du-command/' rel='bookmark' title='Permanent Link: UNIX file size listing &#8211; du command'>UNIX file size listing &#8211; du command</a></li>
<li><a href='http://blog.watashii.com/2008/07/unix-creating-chron-jobs-with-chrontab/' rel='bookmark' title='Permanent Link: Unix &#8211; Creating Cron Jobs with Crontab'>Unix &#8211; Creating Cron Jobs with Crontab</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-268" title="lscolor03" src="http://blog.watashii.com/wp-content/uploads/2009/10/lscolor03.png" alt="lscolor03" width="500" height="81" /></p>
<p>Having command line text in colors makes things easier to read.  For example the <em>ls </em>command for listing directories and files.  In some Unix environments, the  <a href="http://en.wikipedia.org/wiki/Ls" target="_blank"><em>ls</em></a> command may not support the <em>&#8211;color</em> option to let us do that (as it  requires GNU <em>ls</em>).  So how can we workaround this to add color to <em>ls</em>?</p>
<p>Here are my steps to make it happen. Note i&#8217;m no Unix guru, and I didn&#8217;t have time to perfect it.. but it gets the job done!</p>
<p><span id="more-262"></span></p>
<h3>1) Basic test. Echo some random color text.  I had to specify the full path of echo to make it work. The value <strong>01;34 </strong>is the color code for light blue.</h3>
<p><code>/bin/echo "\033[0m\033[<strong>01;34m</strong><em>this is blue text</em>\033[0m"</code></p>
<p><img class="alignnone size-full wp-image-270" title="lscolor01" src="http://blog.watashii.com/wp-content/uploads/2009/10/lscolor01.png" alt="lscolor01" width="575" height="53" /></p>
<h3>2) Here are some other color codes.</h3>
<pre><code>Black       0;30     Dark Gray     1;30
Blue        0;34     Light Blue    1;34
Green       0;32     Light Green   1;32
Cyan        0;36     Light Cyan    1;36
Red         0;31     Light Red     1;31
Purple      0;35     Light Purple  1;35
Brown       0;33     Yellow        1;33
Light Gray  0;37     White         1;37</code></pre>
<h3>3) Here are the ls commands I would like to color&#8230; with a bit of help from Google somewhere.</h3>
<p><code>ls -ld .*/             # List hidden directories<br />
ls -ld */              # List visible directories<br />
ls -lAd .* |grep '^-'  # List hidden files<br />
ls -l |grep '^-'       # List visible files</code></p>
<h3>4) Combining 1 and 3, gives me the following commands:</h3>
<p><code>/bin/echo "\033[0m\033[01;34m`ls -ld .*/`\033[0m"<br />
/bin/echo "\033[0m\033[01;32m`ls -ld */`\033[0m"<br />
/bin/echo "\033[0m\033[00;31m`ls -lAd .* |grep '^-'`\033[0m"<br />
/bin/echo "\033[0m\033[01;33m`ls -l |grep '^-'`\033[0m"</code></p>
<h3>5) Mash it together, assign it to an alias, and thats it! One single action does the job!</h3>
<p><code>alias ll='/bin/echo "\033[0m\033[01;34m`ls -ld .*/`\033[0m" ; /bin/echo "\033[0m\033[01;32m`ls -ld */`\033[0m" ; /bin/echo "\033[0m\033[00;31m`ls -lAd .* |grep '^-'`\033[0m" ; /bin/echo "\033[0m\033[01;33m`ls -l |grep '^-'`\033[0m"'</code></p>
<p><img title="lscolor02" src="http://blog.watashii.com/wp-content/uploads/2009/10/lscolor02.png" alt="lscolor02" width="550" height="502" /></p>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2008/09/unix-ps-command-long-process-listing/' rel='bookmark' title='Permanent Link: Unix ps command &#8211; Long Process Listing'>Unix ps command &#8211; Long Process Listing</a></li>
<li><a href='http://blog.watashii.com/2008/08/unix-file-size-listing-du-command/' rel='bookmark' title='Permanent Link: UNIX file size listing &#8211; du command'>UNIX file size listing &#8211; du command</a></li>
<li><a href='http://blog.watashii.com/2008/07/unix-creating-chron-jobs-with-chrontab/' rel='bookmark' title='Permanent Link: Unix &#8211; Creating Cron Jobs with Crontab'>Unix &#8211; Creating Cron Jobs with Crontab</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2009/10/unix-ls-command-with-colors-without-the-color-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BIAR File Command Line Import &#8211; Bypassing Import Wizard</title>
		<link>http://blog.watashii.com/2009/08/biar-file-command-line-import-bypassing-import-wizard/</link>
		<comments>http://blog.watashii.com/2009/08/biar-file-command-line-import-bypassing-import-wizard/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 09:50:01 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[BusinessObjects]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[biar]]></category>
		<category><![CDATA[import wizard]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=217</guid>
		<description><![CDATA[The command line to import the BusinessObjects Enterprise (XIR2 Unix) exported biar file can be done using the following command: java -jar &#60;BOBJE_HOME&#62;/bobje/java/lib/InstallEntSdkWrapper.jar 'cms_name' 'admininistrator' 'admin_password' 'secEnterprise' &#60;PATH_TO&#62;/MyBiarFile.biar [InstallEntSdkWrapper.main] Connecting to CMS Development as administrator [InstallEntSdkWrapper.main] BIAR Imported Successfully Related Posts:BusinessObjects &#8211; Internal Error when connecting Windows clients BusinessObjects &#8211; Insert Webi Report Images


Related Posts:<ol><li><a href='http://blog.watashii.com/2008/09/businessobjects-internal-error-when-connecting-windows-clients/' rel='bookmark' title='Permanent Link: BusinessObjects &#8211; Internal Error when connecting Windows clients'>BusinessObjects &#8211; Internal Error when connecting Windows clients</a></li>
<li><a href='http://blog.watashii.com/2008/10/businessobjects-insert-webi-report-images/' rel='bookmark' title='Permanent Link: BusinessObjects &#8211; Insert Webi Report Images'>BusinessObjects &#8211; Insert Webi Report Images</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The command line to import the BusinessObjects Enterprise (XIR2 Unix) exported biar file can be done using the following command:</p>
<p><code><span class="postbody">java -jar &lt;BOBJE_HOME&gt;/bobje/java/lib/InstallEntSdkWrapper.jar 'cms_name' 'admininistrator' 'admin_password' 'secEnterprise' &lt;PATH_TO&gt;/MyBiarFile.biar </span></code></p>
<pre><code>[InstallEntSdkWrapper.main] Connecting to CMS Development as administrator
[InstallEntSdkWrapper.main] BIAR Imported Successfully</code></pre>


<p>Related Posts:<ol><li><a href='http://blog.watashii.com/2008/09/businessobjects-internal-error-when-connecting-windows-clients/' rel='bookmark' title='Permanent Link: BusinessObjects &#8211; Internal Error when connecting Windows clients'>BusinessObjects &#8211; Internal Error when connecting Windows clients</a></li>
<li><a href='http://blog.watashii.com/2008/10/businessobjects-insert-webi-report-images/' rel='bookmark' title='Permanent Link: BusinessObjects &#8211; Insert Webi Report Images'>BusinessObjects &#8211; Insert Webi Report Images</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2009/08/biar-file-command-line-import-bypassing-import-wizard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to untar a gz file in Unix</title>
		<link>http://blog.watashii.com/2009/06/how-to-untar-a-gz-file-in-unix/</link>
		<comments>http://blog.watashii.com/2009/06/how-to-untar-a-gz-file-in-unix/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 02:57:10 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[unix untar gz file]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=207</guid>
		<description><![CDATA[For a .gz file, $ gunzip myfile.gz For .tar.gz file, $ gzip -dc myfile.tar.gz &#124; tar xvf -]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-208" title="untargz" src="http://blog.watashii.com/wp-content/uploads/2009/06/untargz.png" alt="untargz" width="256" height="256" /></p>
<p><strong>For a .gz file,</strong></p>
<p>$ gunzip <em>myfile</em>.gz</p>
<p><strong>For .tar.gz file,<br />
</strong></p>
<p>$ gzip -dc <em>myfile</em>.tar.gz | tar xvf -</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2009/06/how-to-untar-a-gz-file-in-unix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Exercise Your Idle System Doing Nothing</title>
		<link>http://blog.watashii.com/2009/04/exercise-your-idle-system-doing-nothing/</link>
		<comments>http://blog.watashii.com/2009/04/exercise-your-idle-system-doing-nothing/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 15:15:49 +0000</pubDate>
		<dc:creator>watashii</dc:creator>
				<category><![CDATA[Unix]]></category>
		<category><![CDATA[null]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[zero]]></category>

		<guid isPermaLink="false">http://blog.watashii.com/?p=178</guid>
		<description><![CDATA[Via Unix/Linux: cat /dev/zero &#62; /dev/null or cp /dev/zero  /dev/null Explaination: /dev/null is basically a black hole (a special null file), anything written to it goes down the drain.  Anything read from it will result in nothing returned.  /dev/zero is basically the same as /dev/null when writing to it, however reading it will result in [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-182" title="sleepy_idle" src="http://blog.watashii.com/wp-content/uploads/2009/04/sleepy_idle.jpg" alt="sleepy_idle" width="450" height="337" /></p>
<p><strong>Via Unix/Linux:</strong></p>
<pre><code>cat /dev/zero &gt; /dev/null</code></pre>
<p>or</p>
<pre><code>cp /dev/zero  /dev/null</code></pre>
<p><strong>Explaination:</strong></p>
<p>/dev/null is basically a black hole (a special null file), anything written to it goes down the drain.  Anything read from it will result in nothing returned.  /dev/zero is basically the same as /dev/null when writing to it, however reading it will result in a continuous stream of zeros without EOF.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.watashii.com/2009/04/exercise-your-idle-system-doing-nothing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

