Creating A Terminal Window Clock

January 10, 2012 by · Leave a Comment
Filed under: bash, command line, HowTo, linux 

If you've been using Linux for a while, you may be familiar with the terminal command, date. The date command will display the current date and time to the terminal. On my system, the default output of date looks like this: Read more

Bash to Basics: The For Loop

February 14, 2010 by · 2 Comments
Filed under: bash, HowTo, linux, Ubuntu 

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. Read more