Posted: . At: 10:18 PM. This was 12 years ago. Post ID: 4534
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


The BASH shell prompt is far superior to the so called command prompt in Windows.


Rasberry PI BASH shell prompt. Connecting with SSH.
Rasberry PI BASH shell prompt. Connecting with SSH.

The Windows command prompt I have been using quite a bit in a Networking and Databases course I am studying right now is really getting on my nerves. Not being able to press CTRL-L to clear the command prompt window, not being able to copy and paste as easily as you can with the Gnome Terminal, this is really annoying me. The Windows command prompt does have some cool commands, you can list running processes with the tasklist command and then kill an offending process with the tskill command, but it is a poor imitation of the superior BASH or Zsh shells. Even TCSH and CSH are far better than the DOS like environment in Linux. In the BASH shell; you may type ps aux | grep me-tv for example to find a hung process and then use kill -9 3737 to kill that process. The -9 parameter to the kill command makes it kill the process without caring about its feelings at all, it makes every effort to kill that offending process. There is a nice page on the Advanced Bash Scripting Guide that contains a nice guide on converting a DOS batch file into a UNIX/Linux equivalent. This is very helpful when you have found an old batch file and thought it might be useful on Linux.

But the *NIX shells are far superior to any Windows equivalent command shell. The Powershell is supposed to be a good alternative, but it is hard to use unless you learn all of the commands that is; the Powershell was originally named MONAD and is supposed to compensate for the fact that a DOS command prompt is a sad alternative to a Linux shell prompt.  Zsh is an alternative to the BASH shell that has many good features. Amongst them is the ability to create a nice prompt theme. This is mine.

.-(~)-----------------------------------------------------------------------------------------------------------------(flynn@flynn-grid-runner)-
`--> uname -a
Linux flynn-grid-runner 3.6.0-rc1-bejiitas #1 SMP PREEMPT Mon Aug 6 20:40:36 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
 
And this code added to the bottom of your ~/.zshrc will create this lovely prompt theme.
<pre>if [ -x /usr/bin/finger ] ; then
   INFO=$(finger -lmps $LOGNAME | sed -e "s/On/Logged in/g" | grep "since" )
else
   INFO=$(uname -msov)
fi
 
echo -e "${YELLOW}"
echo -e "${INFO}"
echo -e "$NORMAL"
 
autoload -U compinit
compinit
autoload -U promptinit; promptinit
prompt adam2 red green red orange
Steve Ballmer uses a Macbook Pro! Windows not good enough for him?
Steve Ballmer uses a Macbook Pro! Windows not good enough for him?

The Powershell and DOS prompts do not have this level of customization. If you are using a Macintosh machine; which runs on a variant of the UNIX kernel and has a proper command prompt window available, then you may install Zsh and enjoy a far superior command-line experience than Windows users. This web page: http://seanmmcdaniel.com/2011/09/zsh-on-os-x/, has a good explanation of how to install the Zsh shell on an Apple Macintosh machine. Windows users like to dump on the Apple users, but the fact is that Windows gets far more viruses than the Apple Macintosh and Linux platforms. Even Steve Ballmer uses an Apple Macintosh laptop whilst vowing to fscking kill Google! That is hilarious, he prefers a stable and reliable UNIX based operating system instead of Windows. Apple uses the Darwin UNIX operating system to build their successful OSX on top of. This may be downloaded in the form of an ISO image here: http://www.puredarwin.org/downloads the Darwin UNIX operating system is an interesting OS, but I could not get the version I downloaded to boot on my computer. The Darwin UNIX operating system is derived from the old NextStep operating system.

That was an operating system that was the desktop that the Doom developers used to create their levels using a level editor they coded. Nowadays you can use the Linux and Windows platforms to do that kind of work. The NextStep operating system interface is now available as the Windowmaker window manager on Linux and UNIX. Shown below is how to install this.

.-(~)-----------------------------------------------------------------------------------------------------------------(flynn@flynn-grid-runner)-
`--&gt; sudo apt-get install gnustep-gui-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libetpan15 dvb-apps libgldi3
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  gnustep-base-common gnustep-common
Suggested packages:
  gnustep-base-doc
The following NEW packages will be installed:
  gnustep-base-common gnustep-common gnustep-gui-common
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 774 kB of archives.
After this operation, 2,462 kB of additional disk space will be used.
Do you want to continue [Y/n]?

Here is another cool trick to try in Linux. Type this command to load the Xnest window.

jason@jason-desktop:~$ Xnest :1

Then run this command and you may run Xterm in a window on your desktop!

jason@jason-desktop:~$ xterm -display :1

1 thought on “The BASH shell prompt is far superior to the so called command prompt in Windows.”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.