<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slackwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Supyrow</id>
	<title>SlackWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.slackwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Supyrow"/>
	<link rel="alternate" type="text/html" href="https://www.slackwiki.com/Special:Contributions/Supyrow"/>
	<updated>2026-04-08T02:40:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=810</id>
		<title>Customizing Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=810"/>
		<updated>2012-12-03T07:02:13Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tips]]&lt;br /&gt;
&lt;br /&gt;
Originally posted by &lt;br /&gt;
http://www.compelitepc.com&lt;br /&gt;
Look under HOWTOs&lt;br /&gt;
&lt;br /&gt;
There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from &amp;quot;\033&amp;quot; or &amp;quot;ESC&amp;quot; commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#.bashrc &lt;br /&gt;
DULL=0&lt;br /&gt;
BRIGHT=1&lt;br /&gt;
FG_BLACK=30&lt;br /&gt;
FG_RED=31&lt;br /&gt;
FG_GREEN=32&lt;br /&gt;
FG_YELLOW=33&lt;br /&gt;
FG_BLUE=34&lt;br /&gt;
FG_VIOLET=35&lt;br /&gt;
FG_CYAN=36&lt;br /&gt;
FG_WHITE=37&lt;br /&gt;
FG_NULL=00&lt;br /&gt;
BG_BLACK=40&lt;br /&gt;
BG_RED=41&lt;br /&gt;
BG_GREEN=42&lt;br /&gt;
BG_YELLOW=43&lt;br /&gt;
BG_BLUE=44&lt;br /&gt;
BG_VIOLET=45&lt;br /&gt;
BG_CYAN=46&lt;br /&gt;
BG_WHITE=47&lt;br /&gt;
BG_NULL=00&lt;br /&gt;
&lt;br /&gt;
ESC=&amp;quot;\033&amp;quot;&lt;br /&gt;
NORMAL=&amp;quot;\[$ESC[m\]&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]&amp;quot;&lt;br /&gt;
BLACK=&amp;quot;\[$ESC[${DULL};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
RED=&amp;quot;\[$ESC[${DULL};${FG_RED}m\]&amp;quot;&lt;br /&gt;
GREEN=&amp;quot;\[$ESC[${DULL};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BLUE=&amp;quot;\[$ESC[${DULL};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
VIOLET=&amp;quot;\[$ESC[${DULL};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
CYAN=&amp;quot;\[$ESC[${DULL};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
WHITE=&amp;quot;\[$ESC[${DULL};${FG_WHITE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLACK=&amp;quot;\[$ESC[${BRIGHT};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
BRIGHT_RED=&amp;quot;\[$ESC[${BRIGHT};${FG_RED}m\]&amp;quot;&lt;br /&gt;
BRIGHT_GREEN=&amp;quot;\[$ESC[${BRIGHT};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_YELLOW=&amp;quot;\[$ESC[${BRIGHT};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLUE=&amp;quot;\[$ESC[${BRIGHT};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_VIOLET=&amp;quot;\[$ESC[${BRIGHT};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
BRIGHT_CYAN=&amp;quot;\[$ESC[${BRIGHT};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_WHITE=&amp;quot;\[$ESC[${BRIGHT};${BG_WHITE}m\]&amp;quot;&lt;br /&gt;
REV_CYAN=&amp;quot;\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]&amp;quot;&lt;br /&gt;
REV_RED=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PROMPT_COMMAND='export ERR=$?'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you happen to use Eterm or other advanced terminal its possible you need a &amp;quot;.bash_profile&amp;quot; here is one you can use if you don't have one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#.bash_profile&lt;br /&gt;
source .bashrc&lt;br /&gt;
if [ -f ~/.bashrc ]; then&lt;br /&gt;
	. ~/.bashrc&lt;br /&gt;
fi &lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets put it to work: I personally would comment out my currently working ##&amp;quot;PS1=&amp;quot; and put it below it in case you need to change it back for some reason.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PS1=&amp;quot;${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.com${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} |&lt;br /&gt;
${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %&amp;gt; ${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should look like this minus the colors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YOUR COMPANY NAME HERE[sales@compelitepc.com]&lt;br /&gt;
[13:57:23][590.478 MB|563.316 MiB][/media/cdrom]&lt;br /&gt;
[503] %&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past.&lt;br /&gt;
&lt;br /&gt;
Now... To get the sum of files in current working directory, I made two files which do the summing. &amp;quot;lsMB&amp;quot; and &amp;quot;lsMiB&amp;quot; which on my system are both located in ~/bin as executable. Here is lsMB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;kB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;MB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;GB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize $suffix&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, this is the lsMiB executable file located in &amp;quot;~/bin&amp;quot; This has the modification for the conversion to KiB, MiB &amp;amp; GiB one could further the code to handle TiB easily by doing some research on it... Try wiki!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMiB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024*.976 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;KiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576*.954 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;MiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824*.931 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;GiB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize2 $suffix2&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One would be able to see the changes if 1) Restart the Terminal or 2) type:&amp;lt;pre&amp;gt;$ source ~/.bashrc&amp;lt;/pre&amp;gt; and you will instantly see the changes.&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=809</id>
		<title>Customizing Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=809"/>
		<updated>2012-12-03T07:01:42Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tips]]&lt;br /&gt;
&lt;br /&gt;
Originally posted by &lt;br /&gt;
http://www.compelitepc.com&lt;br /&gt;
&lt;br /&gt;
There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from &amp;quot;\033&amp;quot; or &amp;quot;ESC&amp;quot; commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#.bashrc &lt;br /&gt;
DULL=0&lt;br /&gt;
BRIGHT=1&lt;br /&gt;
FG_BLACK=30&lt;br /&gt;
FG_RED=31&lt;br /&gt;
FG_GREEN=32&lt;br /&gt;
FG_YELLOW=33&lt;br /&gt;
FG_BLUE=34&lt;br /&gt;
FG_VIOLET=35&lt;br /&gt;
FG_CYAN=36&lt;br /&gt;
FG_WHITE=37&lt;br /&gt;
FG_NULL=00&lt;br /&gt;
BG_BLACK=40&lt;br /&gt;
BG_RED=41&lt;br /&gt;
BG_GREEN=42&lt;br /&gt;
BG_YELLOW=43&lt;br /&gt;
BG_BLUE=44&lt;br /&gt;
BG_VIOLET=45&lt;br /&gt;
BG_CYAN=46&lt;br /&gt;
BG_WHITE=47&lt;br /&gt;
BG_NULL=00&lt;br /&gt;
&lt;br /&gt;
ESC=&amp;quot;\033&amp;quot;&lt;br /&gt;
NORMAL=&amp;quot;\[$ESC[m\]&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]&amp;quot;&lt;br /&gt;
BLACK=&amp;quot;\[$ESC[${DULL};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
RED=&amp;quot;\[$ESC[${DULL};${FG_RED}m\]&amp;quot;&lt;br /&gt;
GREEN=&amp;quot;\[$ESC[${DULL};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BLUE=&amp;quot;\[$ESC[${DULL};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
VIOLET=&amp;quot;\[$ESC[${DULL};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
CYAN=&amp;quot;\[$ESC[${DULL};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
WHITE=&amp;quot;\[$ESC[${DULL};${FG_WHITE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLACK=&amp;quot;\[$ESC[${BRIGHT};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
BRIGHT_RED=&amp;quot;\[$ESC[${BRIGHT};${FG_RED}m\]&amp;quot;&lt;br /&gt;
BRIGHT_GREEN=&amp;quot;\[$ESC[${BRIGHT};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_YELLOW=&amp;quot;\[$ESC[${BRIGHT};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLUE=&amp;quot;\[$ESC[${BRIGHT};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_VIOLET=&amp;quot;\[$ESC[${BRIGHT};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
BRIGHT_CYAN=&amp;quot;\[$ESC[${BRIGHT};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_WHITE=&amp;quot;\[$ESC[${BRIGHT};${BG_WHITE}m\]&amp;quot;&lt;br /&gt;
REV_CYAN=&amp;quot;\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]&amp;quot;&lt;br /&gt;
REV_RED=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PROMPT_COMMAND='export ERR=$?'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you happen to use Eterm or other advanced terminal its possible you need a &amp;quot;.bash_profile&amp;quot; here is one you can use if you don't have one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#.bash_profile&lt;br /&gt;
source .bashrc&lt;br /&gt;
if [ -f ~/.bashrc ]; then&lt;br /&gt;
	. ~/.bashrc&lt;br /&gt;
fi &lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets put it to work: I personally would comment out my currently working ##&amp;quot;PS1=&amp;quot; and put it below it in case you need to change it back for some reason.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PS1=&amp;quot;${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.com${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} |&lt;br /&gt;
${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %&amp;gt; ${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should look like this minus the colors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YOUR COMPANY NAME HERE[sales@compelitepc.com]&lt;br /&gt;
[13:57:23][590.478 MB|563.316 MiB][/media/cdrom]&lt;br /&gt;
[503] %&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past.&lt;br /&gt;
&lt;br /&gt;
Now... To get the sum of files in current working directory, I made two files which do the summing. &amp;quot;lsMB&amp;quot; and &amp;quot;lsMiB&amp;quot; which on my system are both located in ~/bin as executable. Here is lsMB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;kB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;MB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;GB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize $suffix&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, this is the lsMiB executable file located in &amp;quot;~/bin&amp;quot; This has the modification for the conversion to KiB, MiB &amp;amp; GiB one could further the code to handle TiB easily by doing some research on it... Try wiki!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMiB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024*.976 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;KiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576*.954 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;MiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824*.931 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;GiB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize2 $suffix2&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One would be able to see the changes if 1) Restart the Terminal or 2) type:&amp;lt;pre&amp;gt;$ source ~/.bashrc&amp;lt;/pre&amp;gt; and you will instantly see the changes.&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=727</id>
		<title>Customizing Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=727"/>
		<updated>2012-08-05T22:15:26Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tips]]&lt;br /&gt;
&lt;br /&gt;
Originally posted by &lt;br /&gt;
http://insider.compelitepc.host56.com&lt;br /&gt;
&lt;br /&gt;
There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from &amp;quot;\033&amp;quot; or &amp;quot;ESC&amp;quot; commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#.bashrc &lt;br /&gt;
DULL=0&lt;br /&gt;
BRIGHT=1&lt;br /&gt;
FG_BLACK=30&lt;br /&gt;
FG_RED=31&lt;br /&gt;
FG_GREEN=32&lt;br /&gt;
FG_YELLOW=33&lt;br /&gt;
FG_BLUE=34&lt;br /&gt;
FG_VIOLET=35&lt;br /&gt;
FG_CYAN=36&lt;br /&gt;
FG_WHITE=37&lt;br /&gt;
FG_NULL=00&lt;br /&gt;
BG_BLACK=40&lt;br /&gt;
BG_RED=41&lt;br /&gt;
BG_GREEN=42&lt;br /&gt;
BG_YELLOW=43&lt;br /&gt;
BG_BLUE=44&lt;br /&gt;
BG_VIOLET=45&lt;br /&gt;
BG_CYAN=46&lt;br /&gt;
BG_WHITE=47&lt;br /&gt;
BG_NULL=00&lt;br /&gt;
&lt;br /&gt;
ESC=&amp;quot;\033&amp;quot;&lt;br /&gt;
NORMAL=&amp;quot;\[$ESC[m\]&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]&amp;quot;&lt;br /&gt;
BLACK=&amp;quot;\[$ESC[${DULL};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
RED=&amp;quot;\[$ESC[${DULL};${FG_RED}m\]&amp;quot;&lt;br /&gt;
GREEN=&amp;quot;\[$ESC[${DULL};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BLUE=&amp;quot;\[$ESC[${DULL};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
VIOLET=&amp;quot;\[$ESC[${DULL};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
CYAN=&amp;quot;\[$ESC[${DULL};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
WHITE=&amp;quot;\[$ESC[${DULL};${FG_WHITE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLACK=&amp;quot;\[$ESC[${BRIGHT};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
BRIGHT_RED=&amp;quot;\[$ESC[${BRIGHT};${FG_RED}m\]&amp;quot;&lt;br /&gt;
BRIGHT_GREEN=&amp;quot;\[$ESC[${BRIGHT};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_YELLOW=&amp;quot;\[$ESC[${BRIGHT};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLUE=&amp;quot;\[$ESC[${BRIGHT};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_VIOLET=&amp;quot;\[$ESC[${BRIGHT};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
BRIGHT_CYAN=&amp;quot;\[$ESC[${BRIGHT};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_WHITE=&amp;quot;\[$ESC[${BRIGHT};${BG_WHITE}m\]&amp;quot;&lt;br /&gt;
REV_CYAN=&amp;quot;\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]&amp;quot;&lt;br /&gt;
REV_RED=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PROMPT_COMMAND='export ERR=$?'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you happen to use Eterm or other advanced terminal its possible you need a &amp;quot;.bash_profile&amp;quot; here is one you can use if you don't have one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#.bash_profile&lt;br /&gt;
source .bashrc&lt;br /&gt;
if [ -f ~/.bashrc ]; then&lt;br /&gt;
	. ~/.bashrc&lt;br /&gt;
fi &lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets put it to work: I personally would comment out my currently working ##&amp;quot;PS1=&amp;quot; and put it below it in case you need to change it back for some reason.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PS1=&amp;quot;${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.com${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} |&lt;br /&gt;
${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %&amp;gt; ${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should look like this minus the colors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YOUR COMPANY NAME HERE[support@compelitepc.com]&lt;br /&gt;
[13:57:23][590.478 MB|563.316 MiB][/media/cdrom]&lt;br /&gt;
[503] %&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past.&lt;br /&gt;
&lt;br /&gt;
Now... To get the sum of files in current working directory, I made two files which do the summing. &amp;quot;lsMB&amp;quot; and &amp;quot;lsMiB&amp;quot; which on my system are both located in ~/bin as executable. Here is lsMB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;kB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;MB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;GB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize $suffix&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, this is the lsMiB executable file located in &amp;quot;~/bin&amp;quot; This has the modification for the conversion to KiB, MiB &amp;amp; GiB one could further the code to handle TiB easily by doing some research on it... Try wiki!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMiB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024*.976 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;KiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576*.954 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;MiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824*.931 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;GiB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize2 $suffix2&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One would be able to see the changes if 1) Restart the Terminal or 2) type:&amp;lt;pre&amp;gt;$ source ~/.bashrc&amp;lt;/pre&amp;gt; and you will instantly see the changes.&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customising_Bash_Prompt&amp;diff=677</id>
		<title>Customising Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customising_Bash_Prompt&amp;diff=677"/>
		<updated>2012-05-15T20:42:53Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: moved Customising Bash Prompt to Customizing Bash Prompt over redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Customizing Bash Prompt]]&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=676</id>
		<title>Customizing Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=676"/>
		<updated>2012-05-15T20:42:53Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: moved Customising Bash Prompt to Customizing Bash Prompt over redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tips]]&lt;br /&gt;
&lt;br /&gt;
Originally posted by SU_PyRoW &lt;br /&gt;
http://compelitepc.host56.com&lt;br /&gt;
&lt;br /&gt;
There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from &amp;quot;\033&amp;quot; or &amp;quot;ESC&amp;quot; commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#.bashrc &lt;br /&gt;
DULL=0&lt;br /&gt;
BRIGHT=1&lt;br /&gt;
FG_BLACK=30&lt;br /&gt;
FG_RED=31&lt;br /&gt;
FG_GREEN=32&lt;br /&gt;
FG_YELLOW=33&lt;br /&gt;
FG_BLUE=34&lt;br /&gt;
FG_VIOLET=35&lt;br /&gt;
FG_CYAN=36&lt;br /&gt;
FG_WHITE=37&lt;br /&gt;
FG_NULL=00&lt;br /&gt;
BG_BLACK=40&lt;br /&gt;
BG_RED=41&lt;br /&gt;
BG_GREEN=42&lt;br /&gt;
BG_YELLOW=43&lt;br /&gt;
BG_BLUE=44&lt;br /&gt;
BG_VIOLET=45&lt;br /&gt;
BG_CYAN=46&lt;br /&gt;
BG_WHITE=47&lt;br /&gt;
BG_NULL=00&lt;br /&gt;
&lt;br /&gt;
ESC=&amp;quot;\033&amp;quot;&lt;br /&gt;
NORMAL=&amp;quot;\[$ESC[m\]&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]&amp;quot;&lt;br /&gt;
BLACK=&amp;quot;\[$ESC[${DULL};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
RED=&amp;quot;\[$ESC[${DULL};${FG_RED}m\]&amp;quot;&lt;br /&gt;
GREEN=&amp;quot;\[$ESC[${DULL};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BLUE=&amp;quot;\[$ESC[${DULL};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
VIOLET=&amp;quot;\[$ESC[${DULL};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
CYAN=&amp;quot;\[$ESC[${DULL};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
WHITE=&amp;quot;\[$ESC[${DULL};${FG_WHITE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLACK=&amp;quot;\[$ESC[${BRIGHT};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
BRIGHT_RED=&amp;quot;\[$ESC[${BRIGHT};${FG_RED}m\]&amp;quot;&lt;br /&gt;
BRIGHT_GREEN=&amp;quot;\[$ESC[${BRIGHT};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_YELLOW=&amp;quot;\[$ESC[${BRIGHT};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLUE=&amp;quot;\[$ESC[${BRIGHT};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_VIOLET=&amp;quot;\[$ESC[${BRIGHT};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
BRIGHT_CYAN=&amp;quot;\[$ESC[${BRIGHT};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_WHITE=&amp;quot;\[$ESC[${BRIGHT};${BG_WHITE}m\]&amp;quot;&lt;br /&gt;
REV_CYAN=&amp;quot;\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]&amp;quot;&lt;br /&gt;
REV_RED=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PROMPT_COMMAND='export ERR=$?'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you happen to use Eterm or other advanced terminal its possible you need a &amp;quot;.bash_profile&amp;quot; here is one you can use if you don't have one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#.bash_profile&lt;br /&gt;
source .bashrc&lt;br /&gt;
if [ -f ~/.bashrc ]; then&lt;br /&gt;
	. ~/.bashrc&lt;br /&gt;
fi &lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets put it to work: I personally would comment out my currently working ##&amp;quot;PS1=&amp;quot; and put it below it in case you need to change it back for some reason.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PS1=&amp;quot;${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.host56.com${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} |&lt;br /&gt;
${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %&amp;gt; ${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should look like this minus the colors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YOUR COMPANY NAME HERE[support@compelitepc.host56.com]&lt;br /&gt;
[13:57:23][590.478 MB|563.316 MiB][/media/cdrom]&lt;br /&gt;
[503] %&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past.&lt;br /&gt;
&lt;br /&gt;
Now... To get the sum of files in current working directory, I made two files which do the summing. &amp;quot;lsMB&amp;quot; and &amp;quot;lsMiB&amp;quot; which on my system are both located in ~/bin as executable. Here is lsMB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;kB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;MB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;GB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize $suffix&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, this is the lsMiB executable file located in &amp;quot;~/bin&amp;quot; This has the modification for the conversion to KiB, MiB &amp;amp; GiB one could further the code to handle TiB easily by doing some research on it... Try wiki!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMiB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024*.976 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;KiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576*.954 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;MiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824*.931 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;GiB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize2 $suffix2&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One would be able to see the changes if 1) Restart the Terminal or 2) type:&amp;lt;pre&amp;gt;$ source ~/.bashrc&amp;lt;/pre&amp;gt; and you will instantly see the changes.&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=675</id>
		<title>Customizing Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=675"/>
		<updated>2012-05-15T20:40:43Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tips]]&lt;br /&gt;
&lt;br /&gt;
Originally posted by SU_PyRoW &lt;br /&gt;
http://compelitepc.host56.com&lt;br /&gt;
&lt;br /&gt;
There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from &amp;quot;\033&amp;quot; or &amp;quot;ESC&amp;quot; commands into text commands for better reading, modifying or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#.bashrc &lt;br /&gt;
DULL=0&lt;br /&gt;
BRIGHT=1&lt;br /&gt;
FG_BLACK=30&lt;br /&gt;
FG_RED=31&lt;br /&gt;
FG_GREEN=32&lt;br /&gt;
FG_YELLOW=33&lt;br /&gt;
FG_BLUE=34&lt;br /&gt;
FG_VIOLET=35&lt;br /&gt;
FG_CYAN=36&lt;br /&gt;
FG_WHITE=37&lt;br /&gt;
FG_NULL=00&lt;br /&gt;
BG_BLACK=40&lt;br /&gt;
BG_RED=41&lt;br /&gt;
BG_GREEN=42&lt;br /&gt;
BG_YELLOW=43&lt;br /&gt;
BG_BLUE=44&lt;br /&gt;
BG_VIOLET=45&lt;br /&gt;
BG_CYAN=46&lt;br /&gt;
BG_WHITE=47&lt;br /&gt;
BG_NULL=00&lt;br /&gt;
&lt;br /&gt;
ESC=&amp;quot;\033&amp;quot;&lt;br /&gt;
NORMAL=&amp;quot;\[$ESC[m\]&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]&amp;quot;&lt;br /&gt;
BLACK=&amp;quot;\[$ESC[${DULL};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
RED=&amp;quot;\[$ESC[${DULL};${FG_RED}m\]&amp;quot;&lt;br /&gt;
GREEN=&amp;quot;\[$ESC[${DULL};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BLUE=&amp;quot;\[$ESC[${DULL};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
VIOLET=&amp;quot;\[$ESC[${DULL};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
CYAN=&amp;quot;\[$ESC[${DULL};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
WHITE=&amp;quot;\[$ESC[${DULL};${FG_WHITE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLACK=&amp;quot;\[$ESC[${BRIGHT};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
BRIGHT_RED=&amp;quot;\[$ESC[${BRIGHT};${FG_RED}m\]&amp;quot;&lt;br /&gt;
BRIGHT_GREEN=&amp;quot;\[$ESC[${BRIGHT};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_YELLOW=&amp;quot;\[$ESC[${BRIGHT};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLUE=&amp;quot;\[$ESC[${BRIGHT};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_VIOLET=&amp;quot;\[$ESC[${BRIGHT};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
BRIGHT_CYAN=&amp;quot;\[$ESC[${BRIGHT};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_WHITE=&amp;quot;\[$ESC[${BRIGHT};${BG_WHITE}m\]&amp;quot;&lt;br /&gt;
REV_CYAN=&amp;quot;\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]&amp;quot;&lt;br /&gt;
REV_RED=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PROMPT_COMMAND='export ERR=$?'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you happen to use Eterm or other advanced terminal its possible you need a &amp;quot;.bash_profile&amp;quot; here is one you can use if you don't have one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#.bash_profile&lt;br /&gt;
source .bashrc&lt;br /&gt;
if [ -f ~/.bashrc ]; then&lt;br /&gt;
	. ~/.bashrc&lt;br /&gt;
fi &lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets put it to work: I personally would comment out my currently working ##&amp;quot;PS1=&amp;quot; and put it below it in case you need to change it back for some reason.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PS1=&amp;quot;${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@compelitepc.host56.com${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} |&lt;br /&gt;
${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %&amp;gt; ${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should look like this minus the colors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YOUR COMPANY NAME HERE[support@compelitepc.host56.com]&lt;br /&gt;
[13:57:23][590.478 MB|563.316 MiB][/media/cdrom]&lt;br /&gt;
[503] %&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past.&lt;br /&gt;
&lt;br /&gt;
Now... To get the sum of files in current working directory, I made two files which do the summing. &amp;quot;lsMB&amp;quot; and &amp;quot;lsMiB&amp;quot; which on my system are both located in ~/bin as executable. Here is lsMB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;kB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;MB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;GB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize $suffix&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, this is the lsMiB executable file located in &amp;quot;~/bin&amp;quot; This has the modification for the conversion to KiB, MiB &amp;amp; GiB one could further the code to handle TiB easily by doing some research on it... Try wiki!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMiB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024*.976 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;KiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576*.954 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;MiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824*.931 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;GiB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize2 $suffix2&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One would be able to see the changes if 1) Restart the Terminal or 2) type:&amp;lt;pre&amp;gt;$ source ~/.bashrc&amp;lt;/pre&amp;gt; and you will instantly see the changes.&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=508</id>
		<title>Customizing Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=508"/>
		<updated>2011-08-01T11:50:09Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: moved Customizing Bash Prompt to Customising Bash Prompt: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tips]]&lt;br /&gt;
&lt;br /&gt;
Originally posted by SU_PyRoW &lt;br /&gt;
http://compelitepc.host56.com&lt;br /&gt;
&lt;br /&gt;
There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from &amp;quot;\033&amp;quot; or &amp;quot;ESC&amp;quot; commands into text commands for better reading, modifying, or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#.bashrc &lt;br /&gt;
DULL=0&lt;br /&gt;
BRIGHT=1&lt;br /&gt;
FG_BLACK=30&lt;br /&gt;
FG_RED=31&lt;br /&gt;
FG_GREEN=32&lt;br /&gt;
FG_YELLOW=33&lt;br /&gt;
FG_BLUE=34&lt;br /&gt;
FG_VIOLET=35&lt;br /&gt;
FG_CYAN=36&lt;br /&gt;
FG_WHITE=37&lt;br /&gt;
FG_NULL=00&lt;br /&gt;
BG_BLACK=40&lt;br /&gt;
BG_RED=41&lt;br /&gt;
BG_GREEN=42&lt;br /&gt;
BG_YELLOW=43&lt;br /&gt;
BG_BLUE=44&lt;br /&gt;
BG_VIOLET=45&lt;br /&gt;
BG_CYAN=46&lt;br /&gt;
BG_WHITE=47&lt;br /&gt;
BG_NULL=00&lt;br /&gt;
&lt;br /&gt;
ESC=&amp;quot;\033&amp;quot;&lt;br /&gt;
NORMAL=&amp;quot;\[$ESC[m\]&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]&amp;quot;&lt;br /&gt;
BLACK=&amp;quot;\[$ESC[${DULL};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
RED=&amp;quot;\[$ESC[${DULL};${FG_RED}m\]&amp;quot;&lt;br /&gt;
GREEN=&amp;quot;\[$ESC[${DULL};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BLUE=&amp;quot;\[$ESC[${DULL};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
VIOLET=&amp;quot;\[$ESC[${DULL};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
CYAN=&amp;quot;\[$ESC[${DULL};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
WHITE=&amp;quot;\[$ESC[${DULL};${FG_WHITE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLACK=&amp;quot;\[$ESC[${BRIGHT};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
BRIGHT_RED=&amp;quot;\[$ESC[${BRIGHT};${FG_RED}m\]&amp;quot;&lt;br /&gt;
BRIGHT_GREEN=&amp;quot;\[$ESC[${BRIGHT};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_YELLOW=&amp;quot;\[$ESC[${BRIGHT};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLUE=&amp;quot;\[$ESC[${BRIGHT};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_VIOLET=&amp;quot;\[$ESC[${BRIGHT};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
BRIGHT_CYAN=&amp;quot;\[$ESC[${BRIGHT};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_WHITE=&amp;quot;\[$ESC[${BRIGHT};${BG_WHITE}m\]&amp;quot;&lt;br /&gt;
REV_CYAN=&amp;quot;\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]&amp;quot;&lt;br /&gt;
REV_RED=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PROMPT_COMMAND='export ERR=$?'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you happen to use Eterm or other advanced terminal its possible you need a &amp;quot;.bash_profile&amp;quot; here is one you can use if you don't have one, or just want some more in it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#.bash_profile&lt;br /&gt;
source .bashrc&lt;br /&gt;
if [ -f ~/.bashrc ]; then&lt;br /&gt;
	. ~/.bashrc&lt;br /&gt;
fi &lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets put it to work: I personally would comment out my currently working ##&amp;quot;PS1=&amp;quot; and put it below it in case you need to change it back for some reason.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PS1=&amp;quot;${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@yahoo.com${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} |&lt;br /&gt;
${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %&amp;gt; ${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should look like this minus the colors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YOUR COMPANY NAME HERE[su_pyrow@yahoo.com]&lt;br /&gt;
[13:57:23][590.478 MB|563.316 MiB][/media/cdrom]&lt;br /&gt;
[503] %&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past.&lt;br /&gt;
&lt;br /&gt;
Now... To get the sum of files in current working directory, I made two files which do the summing. &amp;quot;lsMB&amp;quot; and &amp;quot;lsMiB&amp;quot; which on my system are both located in ~/bin as executable. Here is lsMB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;kB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;MB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;GB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize $suffix&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, this is the lsMiB executable file located in &amp;quot;~/bin&amp;quot; This has the modification for the conversion to KiB, MiB &amp;amp; GiB one could further the code to handle TiB easily by doing some research on it... Try wiki!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMiB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024*.976 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;KiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576*.954 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;MiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824*.931 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;GiB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize2 $suffix2&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One would be able to see the changes if 1) Restart the Terminal or 2) type:&amp;lt;pre&amp;gt;$ source ~/.bashrc&amp;lt;/pre&amp;gt; and you will instantly see the changes. Try it out, and see if it grows on you!&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=507</id>
		<title>Customizing Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=507"/>
		<updated>2011-08-01T11:44:13Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tips]]&lt;br /&gt;
&lt;br /&gt;
Originally posted by SU_PyRoW &lt;br /&gt;
http://compelitepc.host56.com&lt;br /&gt;
&lt;br /&gt;
There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from &amp;quot;\033&amp;quot; or &amp;quot;ESC&amp;quot; commands into text commands for better reading, modifying, or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#.bashrc &lt;br /&gt;
DULL=0&lt;br /&gt;
BRIGHT=1&lt;br /&gt;
FG_BLACK=30&lt;br /&gt;
FG_RED=31&lt;br /&gt;
FG_GREEN=32&lt;br /&gt;
FG_YELLOW=33&lt;br /&gt;
FG_BLUE=34&lt;br /&gt;
FG_VIOLET=35&lt;br /&gt;
FG_CYAN=36&lt;br /&gt;
FG_WHITE=37&lt;br /&gt;
FG_NULL=00&lt;br /&gt;
BG_BLACK=40&lt;br /&gt;
BG_RED=41&lt;br /&gt;
BG_GREEN=42&lt;br /&gt;
BG_YELLOW=43&lt;br /&gt;
BG_BLUE=44&lt;br /&gt;
BG_VIOLET=45&lt;br /&gt;
BG_CYAN=46&lt;br /&gt;
BG_WHITE=47&lt;br /&gt;
BG_NULL=00&lt;br /&gt;
&lt;br /&gt;
ESC=&amp;quot;\033&amp;quot;&lt;br /&gt;
NORMAL=&amp;quot;\[$ESC[m\]&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]&amp;quot;&lt;br /&gt;
BLACK=&amp;quot;\[$ESC[${DULL};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
RED=&amp;quot;\[$ESC[${DULL};${FG_RED}m\]&amp;quot;&lt;br /&gt;
GREEN=&amp;quot;\[$ESC[${DULL};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BLUE=&amp;quot;\[$ESC[${DULL};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
VIOLET=&amp;quot;\[$ESC[${DULL};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
CYAN=&amp;quot;\[$ESC[${DULL};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
WHITE=&amp;quot;\[$ESC[${DULL};${FG_WHITE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLACK=&amp;quot;\[$ESC[${BRIGHT};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
BRIGHT_RED=&amp;quot;\[$ESC[${BRIGHT};${FG_RED}m\]&amp;quot;&lt;br /&gt;
BRIGHT_GREEN=&amp;quot;\[$ESC[${BRIGHT};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_YELLOW=&amp;quot;\[$ESC[${BRIGHT};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLUE=&amp;quot;\[$ESC[${BRIGHT};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_VIOLET=&amp;quot;\[$ESC[${BRIGHT};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
BRIGHT_CYAN=&amp;quot;\[$ESC[${BRIGHT};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_WHITE=&amp;quot;\[$ESC[${BRIGHT};${BG_WHITE}m\]&amp;quot;&lt;br /&gt;
REV_CYAN=&amp;quot;\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]&amp;quot;&lt;br /&gt;
REV_RED=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PROMPT_COMMAND='export ERR=$?'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you happen to use Eterm or other advanced terminal its possible you need a &amp;quot;.bash_profile&amp;quot; here is one you can use if you don't have one, or just want some more in it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#.bash_profile&lt;br /&gt;
source .bashrc&lt;br /&gt;
if [ -f ~/.bashrc ]; then&lt;br /&gt;
	. ~/.bashrc&lt;br /&gt;
fi &lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets put it to work: I personally would comment out my currently working ##&amp;quot;PS1=&amp;quot; and put it below it in case you need to change it back for some reason.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PS1=&amp;quot;${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@yahoo.com${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} |&lt;br /&gt;
${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %&amp;gt; ${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should look like this minus the colors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YOUR COMPANY NAME HERE[su_pyrow@yahoo.com]&lt;br /&gt;
[13:57:23][590.478 MB|563.316 MiB][/media/cdrom]&lt;br /&gt;
[503] %&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past.&lt;br /&gt;
&lt;br /&gt;
Now... To get the sum of files in current working directory, I made two files which do the summing. &amp;quot;lsMB&amp;quot; and &amp;quot;lsMiB&amp;quot; which on my system are both located in ~/bin as executable. Here is lsMB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;kB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;MB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;GB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize $suffix&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, this is the lsMiB executable file located in &amp;quot;~/bin&amp;quot; This has the modification for the conversion to KiB, MiB &amp;amp; GiB one could further the code to handle TiB easily by doing some research on it... Try wiki!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMiB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024*.976 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;KiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576*.954 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;MiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824*.931 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;GiB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize2 $suffix2&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One would be able to see the changes if 1) Restart the Terminal or 2) type:&amp;lt;pre&amp;gt;$ source ~/.bashrc&amp;lt;/pre&amp;gt; and you will instantly see the changes. Try it out, and see if it grows on you!&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=506</id>
		<title>Customizing Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=506"/>
		<updated>2011-08-01T11:42:51Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tips]]&lt;br /&gt;
# Originally posted by SU_PyRoW &lt;br /&gt;
# &amp;lt;a href=&amp;quot;http://compelitepc.host56.com&amp;quot;&amp;gt;CompElitePC, Inc.&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from &amp;quot;\033&amp;quot; or &amp;quot;ESC&amp;quot; commands into text commands for better reading, modifying, or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#.bashrc &lt;br /&gt;
DULL=0&lt;br /&gt;
BRIGHT=1&lt;br /&gt;
FG_BLACK=30&lt;br /&gt;
FG_RED=31&lt;br /&gt;
FG_GREEN=32&lt;br /&gt;
FG_YELLOW=33&lt;br /&gt;
FG_BLUE=34&lt;br /&gt;
FG_VIOLET=35&lt;br /&gt;
FG_CYAN=36&lt;br /&gt;
FG_WHITE=37&lt;br /&gt;
FG_NULL=00&lt;br /&gt;
BG_BLACK=40&lt;br /&gt;
BG_RED=41&lt;br /&gt;
BG_GREEN=42&lt;br /&gt;
BG_YELLOW=43&lt;br /&gt;
BG_BLUE=44&lt;br /&gt;
BG_VIOLET=45&lt;br /&gt;
BG_CYAN=46&lt;br /&gt;
BG_WHITE=47&lt;br /&gt;
BG_NULL=00&lt;br /&gt;
&lt;br /&gt;
ESC=&amp;quot;\033&amp;quot;&lt;br /&gt;
NORMAL=&amp;quot;\[$ESC[m\]&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]&amp;quot;&lt;br /&gt;
BLACK=&amp;quot;\[$ESC[${DULL};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
RED=&amp;quot;\[$ESC[${DULL};${FG_RED}m\]&amp;quot;&lt;br /&gt;
GREEN=&amp;quot;\[$ESC[${DULL};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BLUE=&amp;quot;\[$ESC[${DULL};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
VIOLET=&amp;quot;\[$ESC[${DULL};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
CYAN=&amp;quot;\[$ESC[${DULL};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
WHITE=&amp;quot;\[$ESC[${DULL};${FG_WHITE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLACK=&amp;quot;\[$ESC[${BRIGHT};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
BRIGHT_RED=&amp;quot;\[$ESC[${BRIGHT};${FG_RED}m\]&amp;quot;&lt;br /&gt;
BRIGHT_GREEN=&amp;quot;\[$ESC[${BRIGHT};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_YELLOW=&amp;quot;\[$ESC[${BRIGHT};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLUE=&amp;quot;\[$ESC[${BRIGHT};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_VIOLET=&amp;quot;\[$ESC[${BRIGHT};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
BRIGHT_CYAN=&amp;quot;\[$ESC[${BRIGHT};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_WHITE=&amp;quot;\[$ESC[${BRIGHT};${BG_WHITE}m\]&amp;quot;&lt;br /&gt;
REV_CYAN=&amp;quot;\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]&amp;quot;&lt;br /&gt;
REV_RED=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PROMPT_COMMAND='export ERR=$?'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you happen to use Eterm or other advanced terminal its possible you need a &amp;quot;.bash_profile&amp;quot; here is one you can use if you don't have one, or just want some more in it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#.bash_profile&lt;br /&gt;
source .bashrc&lt;br /&gt;
if [ -f ~/.bashrc ]; then&lt;br /&gt;
	. ~/.bashrc&lt;br /&gt;
fi &lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets put it to work: I personally would comment out my currently working ##&amp;quot;PS1=&amp;quot; and put it below it in case you need to change it back for some reason.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PS1=&amp;quot;${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@yahoo.com${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} |&lt;br /&gt;
${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %&amp;gt; ${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should look like this minus the colors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YOUR COMPANY NAME HERE[su_pyrow@yahoo.com]&lt;br /&gt;
[13:57:23][590.478 MB|563.316 MiB][/media/cdrom]&lt;br /&gt;
[503] %&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past.&lt;br /&gt;
&lt;br /&gt;
Now... To get the sum of files in current working directory, I made two files which do the summing. &amp;quot;lsMB&amp;quot; and &amp;quot;lsMiB&amp;quot; which on my system are both located in ~/bin as executable. Here is lsMB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;kB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;MB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;GB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize $suffix&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, this is the lsMiB executable file located in &amp;quot;~/bin&amp;quot; This has the modification for the conversion to KiB, MiB &amp;amp; GiB one could further the code to handle TiB easily by doing some research on it... Try wiki!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMiB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024*.976 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;KiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576*.954 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;MiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824*.931 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;GiB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize2 $suffix2&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One would be able to see the changes if 1) Restart the Terminal or 2) type:&amp;lt;pre&amp;gt;$ source ~/.bashrc&amp;lt;/pre&amp;gt; and you will instantly see the changes. Try it out, and see if it grows on you!&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=505</id>
		<title>Customizing Bash Prompt</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Customizing_Bash_Prompt&amp;diff=505"/>
		<updated>2011-08-01T11:33:56Z</updated>

		<summary type="html">&lt;p&gt;Supyrow: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tips]]&lt;br /&gt;
There are allot of white papers on customizing the bash prompt. This one is of course different... by a small margin. It starts by mapping out colors from &amp;quot;\033&amp;quot; or &amp;quot;ESC&amp;quot; commands into text commands for better reading, modifying, or if you change your background and have a transparent terminal running and need to change colors again with out having to remember or look up the color codes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
#.bashrc &lt;br /&gt;
DULL=0&lt;br /&gt;
BRIGHT=1&lt;br /&gt;
FG_BLACK=30&lt;br /&gt;
FG_RED=31&lt;br /&gt;
FG_GREEN=32&lt;br /&gt;
FG_YELLOW=33&lt;br /&gt;
FG_BLUE=34&lt;br /&gt;
FG_VIOLET=35&lt;br /&gt;
FG_CYAN=36&lt;br /&gt;
FG_WHITE=37&lt;br /&gt;
FG_NULL=00&lt;br /&gt;
BG_BLACK=40&lt;br /&gt;
BG_RED=41&lt;br /&gt;
BG_GREEN=42&lt;br /&gt;
BG_YELLOW=43&lt;br /&gt;
BG_BLUE=44&lt;br /&gt;
BG_VIOLET=45&lt;br /&gt;
BG_CYAN=46&lt;br /&gt;
BG_WHITE=47&lt;br /&gt;
BG_NULL=00&lt;br /&gt;
&lt;br /&gt;
ESC=&amp;quot;\033&amp;quot;&lt;br /&gt;
NORMAL=&amp;quot;\[$ESC[m\]&amp;quot;&lt;br /&gt;
RESET=&amp;quot;\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]&amp;quot;&lt;br /&gt;
BLACK=&amp;quot;\[$ESC[${DULL};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
RED=&amp;quot;\[$ESC[${DULL};${FG_RED}m\]&amp;quot;&lt;br /&gt;
GREEN=&amp;quot;\[$ESC[${DULL};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
YELLOW=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BLUE=&amp;quot;\[$ESC[${DULL};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
VIOLET=&amp;quot;\[$ESC[${DULL};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
CYAN=&amp;quot;\[$ESC[${DULL};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
WHITE=&amp;quot;\[$ESC[${DULL};${FG_WHITE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLACK=&amp;quot;\[$ESC[${BRIGHT};${FG_BLACK}m\]&amp;quot;&lt;br /&gt;
BRIGHT_RED=&amp;quot;\[$ESC[${BRIGHT};${FG_RED}m\]&amp;quot;&lt;br /&gt;
BRIGHT_GREEN=&amp;quot;\[$ESC[${BRIGHT};${FG_GREEN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_YELLOW=&amp;quot;\[$ESC[${BRIGHT};${FG_YELLOW}m\]&amp;quot;&lt;br /&gt;
BRIGHT_BLUE=&amp;quot;\[$ESC[${BRIGHT};${FG_BLUE}m\]&amp;quot;&lt;br /&gt;
BRIGHT_VIOLET=&amp;quot;\[$ESC[${BRIGHT};${FG_VIOLET}m\]&amp;quot;&lt;br /&gt;
BRIGHT_CYAN=&amp;quot;\[$ESC[${BRIGHT};${FG_CYAN}m\]&amp;quot;&lt;br /&gt;
BRIGHT_WHITE=&amp;quot;\[$ESC[${BRIGHT};${BG_WHITE}m\]&amp;quot;&lt;br /&gt;
REV_CYAN=&amp;quot;\[$ESC[${DULL};${BG_WHITE};${BG_CYAN}m\]&amp;quot;&lt;br /&gt;
REV_RED=&amp;quot;\[$ESC[${DULL};${FG_YELLOW}; ${BG_RED}m\]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
PROMPT_COMMAND='export ERR=$?'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you happen to use Eterm or other advanced terminal its possible you need a &amp;quot;.bash_profile&amp;quot; here is one you can use if you don't have one, or just want some more in it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#.bash_profile&lt;br /&gt;
source .bashrc&lt;br /&gt;
if [ -f ~/.bashrc ]; then&lt;br /&gt;
	. ~/.bashrc&lt;br /&gt;
fi &lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets put it to work: I personally would comment out my currently working ##&amp;quot;PS1=&amp;quot; and put it below it in case you need to change it back for some reason.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PS1=&amp;quot;${GREEN}YOUR COMPANY NAME HERE${BRIGHT_YELLOW}[${YELLOW}\u@yahoo.com${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_CYAN}[${CYAN}\t${BRIGHT_CYAN}]${BRIGHT_VIOLET}[${VIOLET}\$(lsMB)${BRIGHT_VIOLET} |&lt;br /&gt;
${VIOLET}\$(lsMiB)${BRIGHT_VIOLET}]${BRIGHT_YELLOW}[${YELLOW}\w${BRIGHT_YELLOW}]\n&lt;br /&gt;
${BRIGHT_YELLOW}[${YELLOW}\!${BRIGHT_YELLOW}]${BRIGHT_CYAN} %&amp;gt; ${RESET}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should look like this minus the colors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
YOUR COMPANY NAME HERE[su_pyrow@yahoo.com]&lt;br /&gt;
[13:57:23][590.478 MB|563.316 MiB][/media/cdrom]&lt;br /&gt;
[503] %&amp;gt; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the [503] is the history line number for those who cant remember what they typed or want to input something from the far past.&lt;br /&gt;
&lt;br /&gt;
Now... To get the sum of files in current working directory, I made two files which do the summing. &amp;quot;lsMB&amp;quot; and &amp;quot;lsMiB&amp;quot; which on my system are both located in ~/bin as executable. Here is lsMB:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;kB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;MB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix=&amp;quot;GB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize $suffix&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, this is the lsMiB executable file located in &amp;quot;~/bin&amp;quot; This has the modification for the conversion to KiB, MiB &amp;amp; GiB one could further the code to handle TiB easily by doing some research on it... Try wiki!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#lsMiB free for anyone who wishes to use and implement it, just please show your work. ;)&lt;br /&gt;
let TotalBytes=0&lt;br /&gt;
for Bytes in $(ls -l -a | grep &amp;quot;^-&amp;quot; | awk '{ print $5 }')&lt;br /&gt;
do&lt;br /&gt;
   let TotalBytes=$TotalBytes+$Bytes&lt;br /&gt;
done&lt;br /&gt;
if [ $TotalBytes -lt 1024 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;B&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1048576 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1024*.976 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;KiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1073741824 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1048576*.954 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;MiB&amp;quot;&lt;br /&gt;
else if [ $TotalBytes -lt 1099511627776 ]; then&lt;br /&gt;
   TotalSize2=$(echo -e &amp;quot;scale=3 \n$TotalBytes/1073741824*.931 \nquit&amp;quot; | bc)&lt;br /&gt;
   suffix2=&amp;quot;GiB&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
fi&lt;br /&gt;
echo -n &amp;quot;$TotalSize2 $suffix2&amp;quot;&lt;br /&gt;
#End Script&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One would be able to see the changes if 1) Restart the Terminal or 2) type:&amp;lt;pre&amp;gt;$ source ~/.bashrc&amp;lt;/pre&amp;gt; and you will instantly see the changes. Try it out, and see if it grows on you!&lt;/div&gt;</summary>
		<author><name>Supyrow</name></author>
	</entry>
</feed>