Showing posts with label bash shell. Show all posts
Showing posts with label bash shell. Show all posts

Friday, July 11, 2008

Bash FAQ - Frequently Asked Questions

I was once motivated enough to write a guide on Bash scripting which I chose to call "The 10 Seconds Guide to Bash Scripting" which, if missed, you can read here. Even though many of you may challenge me on the time I claim is enough to read through the guide, I am sure you will find it useful.

Today I came across a collection of tips that are compiled into an FAQ which explain many questions related to Bash scripting. Considering that Bash shell is the default shell for all GNU/Linux distributions and it being bundled with other Unix OSes, it has in my opinion gained more credibility than the erstwhile Bourne shell (which btw is still the default shell for Solaris). The FAQ is maintained by a person named Greg and can be accessed here. There are altogether 75 questions followed by their answers. Aside from being informative, many of them are interesting as well.

While we are on the topic of Bash shell, you may also be interested in reading a list of the common Bash shell keyboard shortcuts.

Tuesday, June 17, 2008

10 Linux shell tricks you don't already know

Venture cake - a new blog on the horizon has written an insightful piece on the different ways in which one can use common commands to achieve complicated tasks in Linux.

The blog author provides examples in achieving the following :
  • A simple way to send output and errors to the same file. It is known as input-output redirection which I had covered a long time back.
  • Parallelize your loops by backgrounding them.
  • Catch memory leaks by using top command via cron.
  • Redirect output from other programs as standard input to a command directly from the command line.
  • Set a random initial password and force the user to change it.
  • Add Your Public Key to Remote Machines the Easy Way
  • Extract an RPM without any additional software
  • See How a File Has Changed from Factory Defaults
  • Undo Your Network Screwups After You’ve Lost the Connection
  • Check which Ports are Open on a remote machine using 'nc' command.
  • The Easy Way to Extract Tar Archives
  • Use Bash Shell variables - not the same as Bash shell shortcuts - I may add.
  • Never reboot a system for NFS failures
Apart from listing examples of each of them, he also provides in a couple of sentences the benefits and drawbacks of each trick. Check out this very interesting article to find out about the examples and explanation provided.

Tuesday, June 3, 2008

Benchmark : Which is the best Linux terminal ?

It has many times occurred to me which terminal among the plethora of terminals at our disposal are the most efficient in terms of speed, memory consumption and ease of use. And I was of the opinion that the ubiquitous xterm was a likely candidate for a terminal with less memory footprint. Well I couldn't have been further from the truth.

It seems xterm is a very poor choice when selecting a terminal. Martin Ankerl benchmarked a number of terminals available in Linux including xterm, gnome-terminal, KDE konsole, wterm, eterm and aterm. And his findings indicate gnome-terminal and konsole as the best choice of terminals for its speed. And by speed I mean the speed of execution of commands in it and not the program's startup time. But the down side is that these two terminals consume a significant amount of memory. For example, Gnome-terminal is found to consume around 45 MB.

Martin states that he found wterm as the best bet for a low memory footprint with just 6.5 MB consumption. And it is sufficiently fast in executing. xterm loses in this department too with each instance consuming around 16 MB.

Do read the full benchmark details and also a nifty graph of his results.

Saturday, May 31, 2008

BASH tips and tricks

Ever since I started using Linux, BASH has been the shell of my choice. Though I have used numerous other shells like Korn Shell, Bourne shell (which is the default shell in Unix), C shell and so on. Bash is actually an acronym for Bourne Again SHell.

Richard Bradshaw who is a teacher at a school in United Kingdom has put together a page detailing some of the common annoyances he has encountered while using BASH and ways of overcoming them.

As a recap, do take a look at some of the previous articles related to BASH shell on this blog such as ...

BASH shell shortcuts,
10 seconds guide to BASH scripting,
BASH completion,
Making your BASH scripts user friendly,
Quick editing of a command and
BASH FAQ ... just to name a few.