<?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>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; bash</title> <atom:link href="http://www.ghacks.net/tag/bash/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Sat, 11 Feb 2012 09:52:46 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Dealing with bash history</title><link>http://www.ghacks.net/2010/11/03/dealing-with-bash-history/</link> <comments>http://www.ghacks.net/2010/11/03/dealing-with-bash-history/#comments</comments> <pubDate>Wed, 03 Nov 2010 18:06:52 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[.bashrc]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[bash history]]></category> <category><![CDATA[command-line]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=36507</guid> <description><![CDATA[If you are a Linux user who frequents the command line, you will most likely have heard of the bash history. This is a special system that keeps a history of all commands run from bash. This has many pros and only a few cons. One of the cons is that, if you are logged [...]]]></description> <content:encoded><![CDATA[<p>If you are a Linux user who frequents the command line, you will most likely have heard of the bash history. This is a special system that keeps a history of all commands run from bash. This has many pros and only a few cons. One of the cons is that, if you are logged onto your machine, someone can see your command line history. There are plenty of situations where you might not want this to happen. In that case, you have to delete your history.</p><p>Let&#8217;s take a look and see how this is done.</p><p><span
id="more-36507"></span><strong>Before we start&#8230;</strong></p><p>There is always a &#8220;before&#8221; right? In this case I wanted to touch base with everyone to make sure it is know how you can work with the bash history. There is one way the bash history is immediately useful to the user. The bash history makes it easy for recalling the last commands run. If you open up a terminal window and start hitting the up arrow on your keyboard you can run through all of the commands contained in your bash history.</p><p>So all you need to do is keep hitting the up arrow until you see the command you wanted to run. This will save you time by keeping you from having to type long commands over and over. It can also help you troubleshoot by showing you what commands you have recently run, which will allow you to deduce what has happened to your machine.</p><p><strong>How to delete the history</strong></p><p>There are two steps to deleting your bash history. The first step is to delete the <strong>~/.bash_history</strong> file. This won&#8217;t work completely because there will still be a history stored in RAM. So, to get rid of THAT history you have to run the command <em>history -c</em>. Once that command is issued, your bash history will be completely clear.</p><p><strong>Not keeping your history</strong></p><p>What if, for whatever reason, you do not want your bash history to be retained at all? You can do this. You can do this for either all users or specific users. To turn off bash history for all users you would need to issue the command:</p><p><code>echo "unset HISTFILE" &gt;&gt; /etc/profile</code></p><p>To turn off bash history for a single user issue the command:</p><p><code>echo "unset HISTFILE" &gt;&gt; /home/USER/.bash_profile</code></p><p>Where USER is the user you want bash history turned off.</p><p>Once you&#8217;ve done either of the above, bash history will be turned off for good.</p><p><strong>History size</strong></p><p>Remember, you can control the size of your bash history by editing the lines in your <strong>~/.bashrc </strong>file:</p><p>HISTSIZE=1000</p><p>Change the entry to match the amount of commands you want to retain in your history.</p><p><strong>Final thoughts</strong></p><p>Bash is an amazing and powerful tool for any and all Linux users. Although you do not have to ever touch the command line, in modern Linux desktops, you may someday have to use the command for either a server or remote access to another desktop. For whatever the reason, you will want to either take advantage of the bash history.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/11/03/dealing-with-bash-history/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Set up your LDAP server on Ubuntu 10.04</title><link>http://www.ghacks.net/2010/08/31/set-up-your-ldap-server-on-ubuntu-10-04/</link> <comments>http://www.ghacks.net/2010/08/31/set-up-your-ldap-server-on-ubuntu-10-04/#comments</comments> <pubDate>Tue, 31 Aug 2010 11:14:20 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Networks]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Server]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[chmod]]></category> <category><![CDATA[Directory Server]]></category> <category><![CDATA[LDAP]]></category> <category><![CDATA[slapd]]></category> <category><![CDATA[ubuntu]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=33779</guid> <description><![CDATA[So lately I&#8217;ve been covering some pretty sweet LDAP tools. You&#8217;ve seen &#8220;Manage your LDAP data with phpLDAPAdmin&#8220;, &#8220;Access and manage your LDAP data with Luma&#8220;, and &#8220;Set up an LDAP server on Fedora&#8220;. Although the last entry showed you how to get a server up and running with the 389 Directory Server GUI, none [...]]]></description> <content:encoded><![CDATA[<p>So lately I&#8217;ve been covering some pretty sweet LDAP tools. You&#8217;ve seen &#8220;<a
title="Manage your data with phpLDAPadmin" href="http://www.ghacks.net/2010/08/30/manage-your-ldap-data-with-phpldapadmin/" target="_blank">Manage your LDAP data with phpLDAPAdmin</a>&#8220;, &#8220;<a
title="Access and manage your LDAP data with Luma" href="http://www.ghacks.net/2010/08/30/access-and-manage-your-ldap-data-with-luma/" target="_blank">Access and manage your LDAP data with Luma</a>&#8220;, and &#8220;<a
title="Set up an LDAP server on Fedora" href="http://www.ghacks.net/2010/08/25/set-up-an-ldap-server-on-fedora/" target="_blank">Set up an LDAP server on Fedora</a>&#8220;. Although the last entry showed you how to get a server up and running with the 389 Directory Server GUI, none of these articles have touched on the tried and true text-based installation and setup of the slapd LDAP server. And that is exactly what we are going to do here.</p><p>But here&#8217;s the thing &#8211; the slapd server can be a real pain to set up. It didn&#8217;t used to be. The old fashion way was to install slapd and then edit the <strong>/etc/ldap/slapd.conf</strong> file to suite your needs. Thing is, the slapd.conf configuration file has been deprecated and now, trying to figure out how to configure slapd is like finding the proverbial needle in the proverbial haystack. Fortunately, in my desperate scouring to work out an easy method of doing this, I have found some tools to make the job easier. And that&#8217;s what this article is all about, getting slapd up and running on a Ubuntu machine so you too can have LDAP running.</p><p><span
id="more-33779"></span><strong>Installation</strong></p><p>Of course there is a bit of installation to take care of before you do anything. But the installation isn&#8217;t challenging and there isn&#8217;t too much to install. Here are the steps you need to follow:</p><ol><li>Open up a terminal window.</li><li>Issue the command <code>sudo apt-get install slapd ldap-utils php5-ldap</code>.</li><li>Type your sudo password and hit Enter.</li><li>Accept any dependencies necessary.</li></ol><p>And that&#8217;s it. You are now ready for the configuration of slapd. But what to do? This article isn&#8217;t about a fancy GUI tool. Instead I have found a script floating around the web (who&#8217;s author I can not name because I have seen this script on a number of sites) which actually makes this process amazingly easy. I have posted the script <a
title="script" href="http://pastebin.com/qGk9CzQ9" target="_blank">here on pastebin</a> for you to either download or copy and paste.</p><p>No matter if you download or copy and paste the script, name it something like <em>ldap_script.sh</em> and save it in your home directory. Once you have it saved give it executable permissions with the command:</p><p><code>chmod u+x ldap_script</code></p><p>Now the script is almost ready. You do have to make a few simple changes. Near the top of the script you will see:</p><p><code>passwd=pleaseeditme<br
/> dc1=pleaseeditme<br
/> dc2=pleaseeditme</code></p><p>Obviously you need to change each <em>pleaseeditme</em> entry to suit your needs. For my LDAP server that section lookes like:</p><p><code>passwd=mypassword<br
/> dc1=wallen<br
/> cd2=local</code></p><p>You will also notice, near the end of the script, it adds a user. The section<em> #Adding user </em>can be edited to suit your needs, or it can be left alone so that at least one correct user is added at first.</p><p>When you have the script ready, it&#8217;s time to execute. Issue the command <em>sudo ./ldap_script</em> and watch the magic fly by. When all is said and done you should then be able to check out your LDAP server with one of the means mentioned in previous articles, or you can issue the command:</p><p><code>﻿ldapsearch -x -h localhost -b "dc=EXAMPLE,dc=COM" "(objectClass=*)"</code></p><p>Where EXAMPLE and COM match your dc entires.</p><p><strong>Final thoughts</strong></p><p>You should now have your LDAP server up and running. You can start adding entries and managing it with whatever tool (or command line) you want. NOTE: We&#8217;ll take a look at the management of LDAP via the command line in later articles. Enjoy your LDAP server!</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/08/31/set-up-your-ldap-server-on-ubuntu-10-04/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Add these handy bash aliases for efficiency</title><link>http://www.ghacks.net/2010/07/05/add-these-handy-bash-aliases-for-efficiency/</link> <comments>http://www.ghacks.net/2010/07/05/add-these-handy-bash-aliases-for-efficiency/#comments</comments> <pubDate>Mon, 05 Jul 2010 18:53:35 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[cli]]></category> <category><![CDATA[command-line]]></category> <category><![CDATA[rpm secure shell]]></category> <category><![CDATA[ssh]]></category> <category><![CDATA[sudo]]></category> <category><![CDATA[update]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=27942</guid> <description><![CDATA[&#8220;In the beginning was the command line&#8221; is not the just name of a great book by Neil Stephensen (read the text here), but a way of life for many Linux users. The command line is the tool for just about any level user. However, the power user takes the command line to newer and [...]]]></description> <content:encoded><![CDATA[<p>&#8220;In the beginning was the command line&#8221; is not the just name of a great book by Neil Stephensen (read the text <a
title="In the beginning was the command line" href="http://www.cryptonomicon.com/beginning.html" target="_blank">here</a>), but a way of life for many Linux users. The command line is <em>the</em> tool for just about any level user. However, the power user takes the command line to newer and many different heights and does so in many different ways.</p><p>One of those ways is with the help of bash aliases. A bash alias is a way to create shortcuts to commands that would normally take a lot of typing or are a challenge to remember. So instead of <em>ssh -v -l jlwallen 192.168.1.10 </em>I could enter just<em> desktop </em>or whatever I want that shortcut to be. In that vein, I am going to offer up some very handy shortcuts for you to add to make your command line usage more efficient.</p><p><span
id="more-27942"></span><strong>Where they go</strong></p><p><strong></strong>If you open up a terminal and issue the command <em>ls -a |less</em> you should come across a file called <strong>~/.bashrc</strong>. This file is very powerful and handles a LOT of tasks. One such task is that of aliases. Within that file you will find the section:</p><p><em># Alias definintions</em></p><p>This is where you put your user-created aliases&#8230;and where we will place the aliases listed below. Once you create the aliases, you will notice they don&#8217;t work within the same terminal you used to add them with your text editor. You have to fire up a new terminal to make sure they work. Because of this, always leave your original terminal open to make sure the new terminal will still work. I have witnessed a user fubar their bash such that the terminal would no longer open. So use caution when randomly closing your terminals. Now, on the aliases.</p><p><strong>Ask before you remove</strong></p><p>Admit it, you&#8217;ve accidentally deleted a file that could have been prevented if you had used the -<em>i </em>switch with the <em>rm</em> command. To avoid this common mistake, let&#8217;s add an alias such that any time the <em>rm</em> command is issued, it is done with the <em>-i</em> switch. This alias would look like:</p><p><em>alias rm=&#8221;rm -i&#8221;</em></p><p><strong>Secure shell</strong></p><p>As I mentioned earlier, secure shell&#8217;ing to a machine can be a real pain when you do it over and over. Create an alias like so:</p><p><em>alias server1=&#8221;ssh -v -l USER ADDRESS&#8221;</em></p><p>Where USER is the user name you would log in with and ADDRESS is the address of the machine you are remoting into.</p><p><strong>Bookmark alias</strong></p><p>Here&#8217;s a fun one. You can open up your browser to a specific bookmark, from the command line with an alias like so:</p><p><em>alias ghacks=&#8221;chromium-browser http://www.ghacks.net&#8221;</em></p><p>Of course you would replace <em>chromium-browser </em>with your default browser and the URL with the address you want the browser to open up to.</p><p><strong>RPM batch installation</strong></p><p>Say you do a lot of batch installations of RPMS. And say you always save your RPM files to <strong>~/RPMS</strong>. You can add an alias to quickly install those RPMS like so:</p><p><em>alias brpm=&#8221;rpm -ivh ~/RPMS/*rpm&#8221;</em></p><p><strong>Update/upgrade with apt</strong></p><p>Instead of having to issue both command for updating apt and upgrading your installation, combine them into one easy to use alias like so:</p><p><em>alias update=&#8221;sudo apt-get update ; sudo apt-get upgrade&#8221;</em></p><p>You will have to enter your sudo password once and the update/upgrade will take place.</p><p><strong>Final thoughts</strong></p><p>Bash aliases are only limited to your imagination. After you spend enough time with the command line you will see that these aliases can really make your day to day Linux life much easier.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/07/05/add-these-handy-bash-aliases-for-efficiency/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Guake: Hide-able terminal goodness</title><link>http://www.ghacks.net/2010/06/21/guake-hide-able-terminal-goodness/</link> <comments>http://www.ghacks.net/2010/06/21/guake-hide-able-terminal-goodness/#comments</comments> <pubDate>Mon, 21 Jun 2010 11:19:21 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Desktop Manager]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[cli]]></category> <category><![CDATA[command-line]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[linux command line]]></category> <category><![CDATA[terminal]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=26885</guid> <description><![CDATA[As you well know, I am a big fan of the Linux command line. Because of this I use the terminal a lot. I am also a fan of Linux eye candy and making my desktop as clean and sleek as possible. I don&#8217;t like to have things in the way and I like easy [...]]]></description> <content:encoded><![CDATA[<p>As you well know, I am a big fan of the Linux command line. Because of this I use the terminal a lot. I am also a fan of Linux eye candy and making my desktop as clean and sleek as possible. I don&#8217;t like to have things in the way and I like easy access to the tools I use. That is why I want my terminal to be easily accessed, always ready, and quick to disappear.</p><p>Guake is a drop-down terminal that fits all of these needs perfectly. It&#8217;s for the GNOME environment and is easy to use and is one of those tools that, once you start using, you&#8217;ll wonder why you hadn&#8217;t been using all along. In this article I will show you how to install and use the Guake drop-down terminal so your Linux command line can be as finger-tip ready as possible.</p><p><span
id="more-26885"></span><strong>Installation</strong></p><p>Fortunately the installation of Guake is simple. Because it lives in the standard repositories of all of the major distributions, you can install Guake with a command like this:</p><p><em>yum install guake</em></p><p><em><span
style="font-style: normal">or</span></em></p><p><em>sudo apt-get install guake</em></p><div
id="attachment_26886" class="wp-caption alignleft" style="width: 435px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/06/guake_icon.png"><img
class="size-full wp-image-26886" src="http://www.ghacks.net/wp-content/uploads/2010/06/guake_icon.png" alt="" width="425" height="48" /></a><p
class="wp-caption-text">Figure 1</p></div><p>If you use the former command you will have to do so after you<em> su</em> to the root user. Once installed you will need to start Guake. You do so by clicking <strong>Applications &gt; Acesssories &gt; Guake Terminal</strong>. Once started Guake will reside in your notification area as an icon (see Figure 1). The icon is the Green downward pointing arrow. If you right-click that icon can access the Guake preferences.</p><p><strong>Configuration</strong></p><p><a
href="http://www.ghacks.net/wp-content/uploads/2010/06/guake_prefs.png"><img
class="alignright size-full wp-image-26887" src="http://www.ghacks.net/wp-content/uploads/2010/06/guake_prefs.png" alt="" width="209" height="244" /></a>There isn&#8217;t too much to configure with Guake. From the preferences window you can take care of such items as:</p><ul><li>The default shell: You will most likely want to stick with the default here.</li><li>Main window height: How tall do you want Guake when it is opened?</li><li>Appearance: Text color/font, background color/transparency/image.</li><li>Various keyboard shortcuts</li></ul><p>By default Guake is not set to start up on login. One of the surprises that always catches me with Guake is you can not set this through the properties window. Instead you will have to set this through the GNOME Start up Applications tool. Access this by clicking <strong>System &gt; Preferences &gt; Startup Applications.</strong> When this window is open scroll down until you find the Guake entry, click the Guake checkbox, and click Close. Now Guake will start up when you log in.</p><p><strong>Usage</strong></p><div
id="attachment_26888" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/06/guake_open.png"><img
class="size-medium wp-image-26888 " src="http://www.ghacks.net/wp-content/uploads/2010/06/guake_open-500x281.png" alt="" width="300" height="169" /></a><p
class="wp-caption-text">Figure 3</p></div><p>To use Guake you simply click the keyboard shortcut configured in the Preferences window. By default that key is F12.  When you click the Open key Guake will drop down for you to use. Figure 3 shows Guake in action, running the top command. By default Guake will remain above all other windows until you dismiss it (by clicking the same key you did to open it).</p><p>You can use Guake as you would a normal terminal window. And, like most good modern terminals, you can have multiple tabs open. To open a new tab in Guake, by default, you higt &lt;Ctrl&gt;&lt;Shift&gt;t.</p><p>If you want to know other handy keyboard shortcuts, go back to the Preferences window and look at the Keyboard shortcuts tab.</p><p><strong>Final thoughts</strong></p><p>If you frequently use the command line, you will very much be glad you have found Guake. With a terminal window so accessible, your work will be that much more efficient. And we all know efficiency is a key factor in every day computing (at least for many of us).</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/06/21/guake-hide-able-terminal-goodness/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Cool bash scripting trick with arrays</title><link>http://www.ghacks.net/2010/06/09/cool-bash-scripting-trick-with-arrays/</link> <comments>http://www.ghacks.net/2010/06/09/cool-bash-scripting-trick-with-arrays/#comments</comments> <pubDate>Wed, 09 Jun 2010 17:05:04 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[arrays]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[notify-send]]></category> <category><![CDATA[shell scripting]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=26366</guid> <description><![CDATA[If you do much bash scripting then you know there are some pretty nifty tricks you can pull off with it. Bash is a very flexible tool. Most Linux users don&#8217;t realize how powerful it is and rarely use it. But when you do need it, it is always there. I play around with bash [...]]]></description> <content:encoded><![CDATA[<p>If you do much bash scripting then you know there are some pretty nifty tricks you can pull off with it. Bash is a very flexible tool. Most Linux users don&#8217;t realize how powerful it is and rarely use it. But when you do need it, it is always there. I play around with bash a lot and employ it for a number of things. The command line is certainly my friend. From the command you do do just about anything &#8211; but sometimes the simplest thing, say counting files in a directory, can elude you. To do this as a command you would issue something like ﻿<em>ls -1 ~/ | wc -l</em>. Not always easy to remember. But say you could create a simple bash script that would count the number of files in a directory as well as list those files. Now that would be cool&#8230;and applicable.</p><p>In this article I am going to introduce you to a simple bash script that will do just that: Count and list the number of files in a directory. The bash script is fairly simple and takes advantage of arrays.</p><p><span
id="more-26366"></span><strong>What is an array?</strong></p><p>If you&#8217;re not sure what an array is, fear not. An array is just a systematic arrangement of objects. This arrangement is usually in rows and columns. Of course there are much more complicated definitions of arrays&#8230;especially when applied to application programming. But for the sake of this bash script, it&#8217;s safe to stop at that definition.</p><p><strong>The script</strong></p><div
id="attachment_26385" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/06/array_code.png"><img
class="size-medium wp-image-26385 " src="http://www.ghacks.net/wp-content/uploads/2010/06/array_code-500x355.png" alt="" width="300" height="213" /></a><p
class="wp-caption-text">Figure 1</p></div><p>The script for the array is fairly simple. Figure 1 displays how the script will look as you edit it in your favorite editor. And for your copy/paste pleasure, I give you the actual code itself:</p><p><strong><em>﻿﻿</em></strong><em>array=(`ls`)</em></p><div><em>wd=`pwd`</em></div><div><em>len=${#array[*]}</em></div><div><em>notify-send &#8220;You have $len objects in $wd.&#8221;</em></div><div><em>i=0</em></div><div><em>while [ $i -lt $len ]; do</em></div><div><em>echo &#8220;$i: ${array[$i]}&#8221;</em></div><div><em>let i++</em></div><div><em>done</em></div><div>Notice the above script takes advantage of the nifty <a
title="Notify send" href="http://www.ghacks.net/2010/06/08/easy-desktop-notification-system/" target="_blank">notify-send command</a> I recently introduced you to. What this script does is use an array to count, list, and number the files within a directory. Now if you look at the code you will see that it also lists out the files (and numbers each of them). This is not practical with the <em>notify-send </em>command so instead we only use the notification system to inform the user how many files are within a directory. That&#8217;s fine because the full output will be within the command line.</div><div>What you need to do is copy that code into a file, save the file (let&#8217;s call it <em>array</em>), and then give that file executable  permissions with the command <em>chmod ugo+x array</em>. I give it user/group/other executable permissions just in case you copy that file to <strong>/usr/bin</strong>.</div><div>Naturally this script is a bit flawed. For instance if you were to copy that script into the <strong>/usr/bin</strong> directory you could run it from any directory and it would give you all of the output you need. However, if you attempt to run that command from the run dialog (hit &lt;Alt&gt;F2) you would receive no output. So this script, as is, is limited to command line.</div><div><div
id="attachment_26373" class="wp-caption alignright" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/06/array.png"><img
class="size-medium wp-image-26373 " src="http://www.ghacks.net/wp-content/uploads/2010/06/array-500x312.png" alt="" width="300" height="187" /></a><p
class="wp-caption-text">Figure 2</p></div></div><div>When you run the script from a command line the results will look like that shown in Figure 2. Here you can see both the <em>notify-send</em> results as well as the printed results in the terminal. Pretty  nifty little trick.</div><div>Obviously this script is a bit limited right? The real purpose of this exercise was to show you a little more advance shell script as well as how a script can interact with the <em>notify-send </em>command.</div><div><strong>Final thoughts</strong></div><div>Shell scripting is an amazingly flexible and useful tool. All of those Linux users who avoid the command line have no idea the power they are missing. With this simple script you can modify it, or use it for any number of possibilities. We&#8217;ll come back to arrays in shell scripting and much, much more.</div> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/06/09/cool-bash-scripting-trick-with-arrays/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Some cool Linux tips/tricks</title><link>http://www.ghacks.net/2010/05/14/some-cool-linux-tipstricks/</link> <comments>http://www.ghacks.net/2010/05/14/some-cool-linux-tipstricks/#comments</comments> <pubDate>Fri, 14 May 2010 20:47:14 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Desktop Manager]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[cut paste]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[linux tips and tricks]]></category> <category><![CDATA[shell script]]></category> <category><![CDATA[ssh]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=25437</guid> <description><![CDATA[It&#8217;s Friday and that means we&#8217;re all ready for the weekend. But that also means we&#8217;re ready for some fun. Because of that I thought it would be fitting to do an article on some of the cooler Linux tips and tricks that I have come across over the years. This article will be a [...]]]></description> <content:encoded><![CDATA[<p>It&#8217;s Friday and that means we&#8217;re all ready for the weekend. But that also means we&#8217;re ready for some fun. Because of that I thought it would be fitting to do an article on some of the cooler Linux tips and tricks that I have come across over the years. This article will be a bit of mish-mash of topics&#8230;but well worth the read. So, without further adieu, let&#8217;s cry havoc and let loose the dogs of war!</p><p><span
id="more-25437"></span><strong>Collaborate with the screen command</strong></p><p>Let&#8217;s say you and your co-worker are both working on debugging an application and your partner has run into a snag. Instead of having to march back and forth between offices, or leaving the comfort of your own chair (you lazy thing), you can log onto your co-workers machine and collaborate! Here&#8217;s how it works. Both machines will be Linux machines and both will have ssh accessibility. If you need to help your co-worker out follow these steps:</p><ol><li>Secure shell into your friends machine&#8230;the only catch is, you have to log on with his username/password.</li><li>Issue the command <em>screen -s NAME </em>Where NAME is any name you want.</li></ol><p>Now your co-worker has to open up a terminal window and issue the command <em>screen -x NAME</em> Where NAME is the same name you used in your command. Now whenever either of you type in your screen both of you will see what is going on at the same time.</p><p>To detach yourself from this session you have to hit &lt;Ctrl&gt;a and then d. That means hold down &lt;Ctrl&gt;, hit a, and then hit d. You will be released from the session.</p><p><strong>Execute files as programs in GNOME<br
/> </strong></p><p>Say you have that killer bash script you use for something tucked away in your home directory. You can run that script by open up a terminal window and issuing the command to run the script, OR&#8230;you can set up Nautilus so that files can be run with a simple double click. Now, use caution with this, because it can open up security issues. But if you know you are safe (are you ever really safe?) you can set this feature.</p><p>To set this up open up Nautilus to the directory that will house the script and then right-click the script and select Properties. In this new window click on the Permission tab and then check the box for Execute. Close the Properties window and then, back in Nautilus, double click that script and see what happens&#8230;it should execute.</p><p><strong>Double your copy/paste pleasure</strong></p><p>You have have heard me mention before how Linux has a cool way to copy paste. You simply highlight what you want to copy with the left mouse button (click and drag to select) and then click the middle mouse button to paste. But did you know that form of copy/paste does not effect the traditional &lt;Ctrl&gt;c/&lt;Ctrl&gt;v? That&#8217;s right. So effectively you have a primary and secondary buffer for copy/paste. You can highlight section A with the left mouse button drag/highlight method and then copy section B with the standard &lt;Ctrl&gt;c method. Now you two different pieces of text to paste &#8211; one with the middle mouse button and the other with &lt;Ctrl&gt;v! Sweet.</p><p><strong>Final thoughts</strong></p><p>There&#8217;s your fun friday Linux tricks. Now, go out and enjoy the weekend! Or just sit at home and continue to rock away on your Linux box.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/05/14/some-cool-linux-tipstricks/feed/</wfw:commentRss> <slash:comments>12</slash:comments> </item> <item><title>Linux command line tips</title><link>http://www.ghacks.net/2010/01/18/linux-command-line-tips/</link> <comments>http://www.ghacks.net/2010/01/18/linux-command-line-tips/#comments</comments> <pubDate>Mon, 18 Jan 2010 16:14:53 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[bash history]]></category> <category><![CDATA[cli]]></category> <category><![CDATA[command-line]]></category> <category><![CDATA[linux commands]]></category> <category><![CDATA[tab completion]]></category> <category><![CDATA[terminal]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=22425</guid> <description><![CDATA[I thought it would be useful to break away from all the GUI-goodness and offer up a few command line tips and tricks. Why? No matter how powerful, user-friendly, and modern the Linux desktop becomes, there may come a time when you want to step up your game and get down and dirty with the [...]]]></description> <content:encoded><![CDATA[<p>I thought it would be useful to break away from all the GUI-goodness and offer up a few command line tips and tricks. Why? No matter how powerful, user-friendly, and modern the Linux desktop becomes, there may come a time when you want to step up your game and get down and dirty with the command line interface. When you do, you will want your command-fu to be strong. And whether you are brand new to the command line, or have any level of familiarity with this tool, there are tips and tricks out there to make your life easier. This article should at least offer one or two of those tips&#8230;no matter your level of skill.</p><p><span
id="more-22425"></span><strong>Tab completion</strong></p><p>This tip is for the novice. There are a lot of commands on the Linux operating system (in my <strong>/usr/bin</strong> directory there is 1736 commands). Hard to remember all of them. Or sometimes a command will have a number of variations (like in the case of <em>beagle</em>) And sometimes, it&#8217;s just tiring typing all of those commands. Fortunately the Tab key is there to help you out. Open up your terminal window and do the following:</p><ol><li>Type <em>beagle</em></li><li>Hit the Tab key twice</li></ol><p>You should see a complete listing of all commands that start with <em>beagle</em>. Say you want to run <em>beagle-index-info</em>. You can do this by typing <em>beagle-ind</em> and then hitting the Tab key one time.</p><p><strong>Run second command with first commands arguments</strong></p><p>Say you need to find out what the directory <strong>/home/jlwallen/.e16/themes </strong>contains, but when you run the command <em>ls /home/jlwallen/.e16/themes</em> you see that the directory doesn&#8217;t exist. Looks like you will have to create that directory. Normally you would do this by typing <em>mkdir /home/jlwallen/.e16/themes </em>(or <em>mkdir ~/.e16/themes</em>). You can use a neat little trick to take the arguments from the previous command and add them to a new command like so:</p><p><em>mkdir !*</em></p><p>The above command would be the equivalent of (in our example above) <em>mkdir /home/jlwallen/.e16/themes</em>).</p><p><strong>Search your bash history</strong></p><p>If you can&#8217;t remember how you ran a specific command, you can use your bash history to help you. If you hit <strong>&lt;Ctrl&gt;r </strong>you will be in a special bash search prompt that looks like:</p><p><code>(reverse-i-search)`':</code></p><p>From this prompt you can enter a portion of the command and immediately see a command that contains what you type. If the command is the one you are looking for, hit the Enter key to execute that command.</p><p><strong>Another method of searching bash history</strong></p><p>This one is simple. If you can&#8217;t remember the last few commands you entered, just hit the up arrow on your keyboard to look through the list. When you find the command you want to run, hit Enter.</p><p><strong>Create recursive directories with one command</strong></p><p>Have you ever had to create entire directory trees and did so like:</p><p><em>mkdir ~/test</em></p><p><em>mkdir ~/test/test1</em></p><p><em>mkdir ~/test/test1/test2</em></p><p><em>mkdir ~/test/test1/test2/test3</em></p><p>You create all of these subdirectories with a single command:</p><p><em>mkdir -p ~/test/test1/test2/test3</em></p><p><strong>Run a second command only if first command succeeds</strong></p><p>You can string two commands together in such a way that the second of the two commands will work if (and only if) the first command succeeds. Let&#8217;s say you are going to use the <em>wget </em>command to download a tar file and then you want to immediately unpack that file. You could do so with this:</p><p><em>wget http://ADDRESS_OF_SERVER/filename.tgz &amp;&amp; tar xvzf filename.tgz</em></p><p>The above would unpack <em>filename.tgz </em>if (and only if) it is successfully downloaded.</p><p><strong>Final thoughts</strong></p><p>That should get you going for a bit. I&#8217;ll revisit this topic in the future so you can keep your command-fu skills sharp. And, by all means, if you have a cool command-line tip you want to share, please do so.</p><p><strong><br
/> </strong></p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/01/18/linux-command-line-tips/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Get to know Linux: Bash scripting basics</title><link>http://www.ghacks.net/2009/05/20/get-to-know-linux-bash-scripting-basics/</link> <comments>http://www.ghacks.net/2009/05/20/get-to-know-linux-bash-scripting-basics/#comments</comments> <pubDate>Wed, 20 May 2009 18:23:46 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[bash scripting]]></category> <category><![CDATA[Hello World!]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=12956</guid> <description><![CDATA[After using Linux for a while you will eventually find yourself needing to create a bash script. And just what is a bash script? A bash script is a script that is run through the bash shell. Usually a bash script is a user-generated script that serves a specific purpose and combines numerous commands into [...]]]></description> <content:encoded><![CDATA[<p>After using Linux for a while you will eventually find yourself needing to create a bash script. And just what is a bash script? A bash script is a script that is run through the bash shell. Usually a bash script is a user-generated script that serves a specific purpose and combines numerous commands into one convenient script.</p><p>I am a big fan of bash scripting. I use them frequently to create backup scripts, scripts that are used via cron, and much more. But before I could write even a simple bash script, I had to understand the basics. And that&#8217;s what you will learn here &#8211; the very basics of bash scripting. This will be a foundation you can build upon so that your bash scripts can get more and more complex.</p><p><span
id="more-12956"></span><strong>The structure</strong></p><p>A bash script consists of just a few pieces. First and foremost you have to actually create the file. This file will contain all of your scripting and will have to be made executable by the user. Once the file is complete and saved you will make this executable with the command:</p><p><em>chmod u+x FILENAME</em></p><p>Where FILENAME is the actual name of your file.</p><p>Now within the file you will have to at least have two minimal pieces:</p><ul><li>Shell declaration</li><li>Script</li></ul><p>The shell declaration is a statement that declares what shell you are to use. For nearly all of your Linux needs you will use the bash shell. To declare the bash shell being used your declaration will be:</p><p><em>#! /bin/bash</em></p><p>With that declaration all commands will be run through the bash shell.</p><p>The script is the contents of the shell script you will write. The script will most often consist of commands.</p><p><strong>Hello world</strong></p><p>Ah hello world! Who hasn&#8217;t or used this as an example. Let&#8217;s take a look at what an Hello World script wold look like. We&#8217;ll add a few variations to highlight some of the subtle differences.</p><p>The basic Hello World! script would look like:</p><p><code>#! /bin/bash<br
/> echo "Hello World!"</code></p><p>Once you save it (we&#8217;ll call it &#8220;hello&#8221;) and make it executable you can run it by issuing the command:</p><p>~/hello</p><p>and you will see the output:</p><p><em>Hello World!</em></p><p>Now let&#8217;s use variable declaration in this script. Using variables will make your scripting much more versatile.</p><p><code>#! /bin/bash<br
/> STRING1="Hello"<br
/> STRING2="World!"<br
/> echo $STRING1 $STRING2</code></p><p>Now let&#8217;s modify this to use a global variable. One useful global variable is USER. At the bash prompt enter <em>echo $USER </em>and bash will return the username that is currently logged in. So change your hello world script to look like:</p><p><code>#! /bin/bash<br
/> STRING1="Hello"<br
/> echo $STRING1 $USER</code></p><p>When you run this script you will see:</p><p><em>Hello USER</em></p><p>Where USER is the actual username logged in. You can test this by su&#8217;ing to a different user (such as root) and running the script. If you are root (make sure you su to root with the command <em>su &#8211; </em>or you won&#8217;t have root&#8217;s prompt, only root&#8217;s privileges) you will see:</p><p>Hello root</p><p><strong>Final thoughts</strong></p><p>And there you have the very fundamentals of bash scripting. Hopefully you can see how to build on the Hello World! example.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/05/20/get-to-know-linux-bash-scripting-basics/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Get To Know Linux: gnome-terminal</title><link>http://www.ghacks.net/2009/02/06/get-to-know-linux-gnome-terminal/</link> <comments>http://www.ghacks.net/2009/02/06/get-to-know-linux-gnome-terminal/#comments</comments> <pubDate>Fri, 06 Feb 2009 03:56:20 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Desktop Manager]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[command-line]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[gnome-terminal]]></category> <category><![CDATA[prompt]]></category> <category><![CDATA[terminal]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=10353</guid> <description><![CDATA[If you use Linux for any amount of time, then most likely you have experienced the command line. And if you use the GNOME desktop environment then you know gnome-terminal. As far as terminals are concerned, gnome-terminal is one of the most versatile of the terminals. It features tabs, colored text, mouse event support, profiles, [...]]]></description> <content:encoded><![CDATA[<p>If you use Linux for any amount of time, then most likely you have experienced the command line. And if you use the GNOME desktop environment then you know gnome-terminal. As far as terminals are concerned, gnome-terminal is one of the most versatile of the terminals. It features tabs, colored text, mouse event support, profiles, real transparency, compositing, and more. And of course you get glorious Linux commands!</p><p>The gnome-terminal comes pre-installed with any GNOME desktop installation, so if you&#8217;re running GNOME you won&#8217;t have to do any further installation. You might, however, want to undertake some configuration changes. We&#8217;ll examine some of those options here.</p><p><span
id="more-10353"></span></p><div
id="attachment_10355" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2009/02/gnome_terminal_main.png"><img
class="size-medium wp-image-10355" src="http://www.ghacks.net/wp-content/uploads/2009/02/gnome_terminal_main-500x356.png" alt="Default gnome-terminal Window" width="300" height="214" /></a><p
class="wp-caption-text">Default gnome-terminal Window</p></div><p>When you start up the gnome-terminal you will be greeted by the default profile with a single tab open.</p><p>The default features you will notice immediately are the menu bar and the scroll bar. Outside of the bash prompt, the menu bar will be where you take care of most of your gnome-terminal business. Let&#8217;s examine what you will find in each menu entry:</p><p><strong>File:</strong> In this menu entry you can open/close a new tab, open/close a new terminal, and/or create a new profile.</p><p><strong>Edit:</strong> In this menu entry you can copy/paste, edit your profiles, and/or configure keyboard shortcuts.</p><p><strong>View: </strong>In this menu entry you can configure gnome-terminal to show/hide the menubar, and/or the scrollbar or you can zoom in or out.</p><p><strong>Terminal:</strong> In this menu entry you can change your profile, change your window title, set character encoding, reset your terminal, and/or reset and clear your terminal.</p><p><strong>Tabs:</strong> In this menu entry you can cycle through your open tabs and/or detach a tab (so it is its own window).</p><p><strong>Help:</strong> In this menu entry you can open up the GNOME Help system to learn about gnome-terminal and you can open the &#8220;about gnome-terminal&#8221; window.</p><p>That&#8217;s it for the tabs.</p><p>As I mentioned, the gnome-terminal is fairly configurable. You can make this terminal as minimal as you like. You can remove the scrollbar and the menubar if you like. To do this click on the View menu and de-select both the scrollbar and the menubar. What that leaves you with is nothing more than a terminal prompt in a window. Or does it? If you right click anywhere in the gnome-terminal window a menu will appear. From that menu you can select to, once again, show the menubar. Once the menubar is back you can then select to show the scrollbar.</p><p><strong>Profiles</strong></p><p>One of the nicest aspects of the gnome-terminal is that you can create profiles. Each profile can reflect, say, a different job. Say you want to have a root user profile. This can make for an easy way to instantly know you are using the root user (so you don&#8217;t commit any command-line fouls that could damage your system). To create a new profile click on File and then select New Profile.  What you will see is a small window asking you to name the new profile and base the new profile on a pre-existing profile.</p><p>Once the new profile is named the main Profile editor window will appear where you can really tweak your profile. There are six tabs within the Profile editor:</p><p><strong>General: </strong>Configure the general options such as name, font, show menubar, terminal bell.</p><p><strong>Title and Command: </strong>Give this profile an initial title and run custom commands (such as automatically listing directory contents when a profile is opened.)</p><p><strong>Colors: </strong>Foreground and background colors.</p><p><strong>Background: </strong>Configure a background image or window transparency.</p><p><strong>Scrolling: </strong>Place the scroll bar and define how far back it will scroll.</p><p><strong>Compatibility: </strong>Configure the backspace and delete keys.</p><p><strong>Final thoughts</strong></p><p>I have used many terminals in my day, but the gnome-terminal is one of the finest. Not only is it very compatible, it is useful and user-friendly. If you use the GNOME desktop (or an alternative desktop), make sure you get to know gnome-terminal for all your command line goodness.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/02/06/get-to-know-linux-gnome-terminal/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Save Your Skin by Customizing Your Bash Prompt</title><link>http://www.ghacks.net/2009/01/06/save-your-skin-by-customizing-your-bash-prompt/</link> <comments>http://www.ghacks.net/2009/01/06/save-your-skin-by-customizing-your-bash-prompt/#comments</comments> <pubDate>Tue, 06 Jan 2009 20:21:28 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Advanced]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[.bashrc]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[bash customization]]></category> <category><![CDATA[terminal]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=9685</guid> <description><![CDATA[If you do much work at the Linux command line then you know the bash prompt can offer you a lot of information. But by default the prompt itself isn&#8217;t too useful.  What you might not know is that you can customize the bash prompt in many ways. From configuring colors to the information bash [...]]]></description> <content:encoded><![CDATA[<p>If you do much work at the Linux command line then you know the bash prompt can offer you a lot of information. But by default the prompt itself isn&#8217;t too useful.  What you might not know is that you can customize the bash prompt in many ways. From configuring colors to the information bash reports, there are so many variations on the bash prompt you could play for days.</p><p>But there is one configuration you can do that is more helpful than any other. Have you ever accidentally issued a standard user command as the root user only to find yourself really regretting that command a millisecond later? It&#8217;s a common new Linux user mistake, but one that can be prevented. You&#8217;ll learn how to help yourself out here.</p><p><span
id="more-9685"></span>Before we get into the actual configuration (and how you can help yourself), let&#8217;s take a look at some basics. From your command line issue the following command <em>echo $PS1</em>. What you should see is the string that comprises your current default bash prompt. When I issue this command I see <strong>[\u@\h \W]\$</strong> and my prompt looks like <strong>[jlwallen@localhost ~]$</strong>. Let me explain what the components of the string are.</p><p>[ - When used alone this is simply a printed character.</p><p>\u - This prints out the current username.</p><p>@ - When used alone this is simply a printed character.</p><p>\h - This prints out the hostname of the machine up to the first dot.</p><p>\W - This prints out the basename of the current working directory (with the users home directory represented by the "~" character.</p><p>] &#8211; When used alone this is simply a printed character.</p><p>\$ &#8211; If root user this prints a &#8220;#&#8221; character, otherwise it prints a &#8220;$&#8221; character.</p><p>So let&#8217;s say you want to be clever and have a prompt that looks like <strong>URHERE (~):</strong></p><p>To create this issue the command:</p><p><em>PS1=&#8221;URHERE (\W): &#8220;</em></p><p>What the above command does is temporarily set your bash prompt. This prompt will last until you close out your terminal window. When you open a new terminal your default prompt will return.</p><p>To make this permanent you will need to open up your <strong>.bashrc</strong> file and add the line you entered as a command. The default <strong>.bashrc</strong> file might look like:</p><p><em># .bashrc</em></p><p><em># User specific aliases and functions<br
/> ? () { echo &#8220;$*&#8221; | bc -l; }</em></p><p><em># Source global definitions<br
/> if [ -f /etc/bashrc ]; then<br
/> . /etc/bashrc<br
/> fi</em></p><p>If you want to make this permanent add the line <em>PS1=&#8221;URHERE </em>(\W): &#8220;<em> </em>right under the <em># .bashrc</em> line. Save that file and open up a new prompt. Voila!</p><p><strong>Adding Color</strong></p><p>Okay, let&#8217;s take it to 11. One trick I like to employ is configuring the root prompt to be a different color than the standard user prompt. This way, if I see a red prompt, I instantly know I am dealing with the root user. Here is the trick with adding color. First you have to use a special string to indicate the beginning of a color. That string is:</p><p><em>\e[</em></p><p>Now to end a color you use the special string:</p><p><em>\e[m</em></p><p>For the color red you would use the string:</p><p>1;31m</p><p>So if you want the string <em>URHERE</em> to show up in red and the directory to remain the default white you would enter into the root user&#8217;s .bashrc file:</p><p>PS1=&#8221;\e[1;31mURHERE\e[m (\W): &#8221;</p><p>Here are the various colors you can use.</p><ul><li>0;30 &#8211; Black</li><li>0;31 &#8211; Red</li><li>0;32 &#8211; Green</li><li>0;33 &#8211; Brown</li><li>0;34 &#8211; Blue</li><li>0;35 &#8211; Purple</li><li>0;36 &#8211; Cyan</li></ul><p>The 0 equals the dark variation of the color and a 1 equals the lighter variation of the color.</p><p><strong>Final Thoughts</strong></p><p>You can really get creative with the bash prompt. With the basics you have learned here you can make your prompt both unique and helpful. If you come up with something really incredible post it here for all to enjoy!</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/01/06/save-your-skin-by-customizing-your-bash-prompt/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> </channel> </rss>
