LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

Replacing That Big Fat Bash

It’s actually a tip from Lincoln, who emailed me last month:

Another idea is to replace bash (~4M/instance) with pdksh (~1M/instance). It doesn’t sound like much, but if you’re like me and you’re have a half-dozen or more concurrent ssh sessions, plus you’re su’ed on a couple of them, etc… it can be a significant help.

Indeed. Bash, which is the default interactive shell on most (if not all) Linux distributions, has pretty much become THE user interface of the command line users. When I first used it in mid-90’s (on SunOS/Solaris), it was a great relief from the plain vanilla bourne shell, and was much better than the default shell back then, korn shell, IMHO. It was love at first sight.

However over the years she has just gone fatter, heavier and was getting more and more CPU intensive to start. It did not really bother me though, as my main computer has also grown in grunt… Not until are trying to run it on a small low end box!

pdksh seems to be quite a good replacement. It uses relatively less resource, has simple tab completion, has history (what else do you need from an interactive shell?) and has bourne shell style syntax (if csh/tcsh is not your thing).

If you are really extreme and thinking tab completion and command line history are for n00bs, also give dash a try. Here’s a memory usage comparison:

USER   PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root  8658  0.0  2.8   3788  1848 pts/0    S    20:42   0:00 bash
root  8732  0.2  0.7   1604   464 pts/0    S    20:44   0:00 dash
root  8733  0.0  0.8   2844   552 pts/0    S    20:44   0:00 pdksh

For me, I’ll stick with bash for now. You know, user interface is the thing that once you got used to, it’s hard to unattach yourself from (i.e. too old to learn new things). Good luck young padawans for picking up new light weight shells!

LEA
Latest posts by LEA (see all)

1 Comment

  1. ER:

    Half a dozen concurrent ssh sessions? Try screen :P One session, you can split horizontally/vertically, multiple “tabs”, it’s great.

    February 24, 2012 @ 7:30 pm | Reply

Leave a Reply

Some notes on commenting on LowEndBox:

  • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
  • Akismet is used for spam detection. Some comments may be held temporarily for manual approval.
  • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

Your email address will not be published. Required fields are marked *