Tag Archives: HowTo

Bash to Basics: The For Loop

Previously I’ve shown how to use the bash while loop in a bash script. Today I’m going to show how to use another type of do loop in bash: the for loop.

The for loop is a little different from the other looping structures in bash. The other loop structures work by evaluating whether an expression is true or false. The for loop works on lists of values. As long as there are items left in the list, the for loop will execute.

Here’s a basic example. Continue reading

How To Uninstall LAMP in Ubuntu 9.10 Karmic Koala

Update: I’ve written a simpler procedure that will uninstall LAMP with a single command. I’m leaving this post here for historical reasons, but the process is much faster if you follow my newer post.


The most popular post on this blog is How to Install LAMP on Ubuntu 9.10. On that post, I’ve had a few comments asking how to remove the single command LAMP installation. Perhaps the something went wrong during the installation and you want to completely remove everything and start over. Or maybe you just decided you don’t need it installed any more and don’t want the extra files and processes cluttering up your system. For whatever reason, due to popular demand… Continue reading

Command Line Basics: Count Files

You may have an occasion that you want to know the number of files in a directory. There are a couple of simple ways to do this. The first way is to list the files with ls and count them with wc. No, wc doesn’t stand for the place you go to relieve yourself; in this case, it stands for word count. The command looks like this: Continue reading

How To Create PDF’s Of GNU/Linux Manpages

If you’re a heavy user of the GNU/Linux command line, then you’re already familiar with the man command. If you’re a newbie, the man command (short for manual, as in RTFM) pulls up the online documentation for terminal commands and outputs it to the same terminal. Perhaps you wish you could have some of these handy documents loaded on your PDA or smartphone as a reference. Continue reading