Bash Script - Example
Bash Scripts - An example
I thought I might share with you, those that are interested that is, how you might write your own useful "bash script". Well just what is a "Bash" script? to answer that you first need to know where the word Bash comes from, it is a *nix term given to one of the many various shell(s) in use the likes of Unix, Linux and yes Mac's, of which these are only accessible from the terminal. A terminal console on it's own does very little it needs to run using a shell of some sought, these shells and by now there are a few of them for *nix family essentially do different jobs, but the one you are most likely to use is the bash shell as it is perhaps the most popular.Wave File to Mp3
Lame encoding from .wav to .mp3
I am no audio expert but given that the "ripping and encoding" tool I used to use "Grip" is no longer available within the Ubuntu repositories, I have had to resort to something else. Grip as an application has not been updated much since it was released and this along with other applications need to be continually bettered and updated. I liked "Grip" a lot and was saddened that it is no longer available in the Ubuntu repositories.Automated Backups
There are few things more satisfying than a good backup
Introduction
Backups rely for the most part, on*unix at least (something called "cron" jobs), wikipedia defines cron as follows:-
Cron is a time-based job scheduler in Unix-like computer operating systems. The name cron comes from the word "chronos", Greek for "time". Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading email.
Cron is without doubt the workhorse of the *unix system it schedules all the jobs you want completed at a certain time. You need to think of cron as nothing more than an alarm clock. The only difference with this alarm clock is that multiple alarms can be set to run multiple single instruction commands or scripts. You perhaps better off to think of cron as a table this table allows instructions by way of digits, wild cards and commands that can be entered on one or more instances.
How to obtain your UUID
Find out your UUID for an attached drive
For quite some time now the likes of Ubuntu and other Linux distributions have used UUID to determine any attached storage devices for mounting, for many of us whilst we see the value of such things finding out how the UUID is derived or for that matter checking the UUID is a bit of a mystery. Well rest easy because by using the command below can can quickly and easily find out this information yourself.Search Your Command History
Clever control sequence for pre-used console commands
You know how it is, you open a new terminal window assured you know the command you want to use you make a cup of coffee and then you forget the command you where to use. Obviously you need better coffee! Or you can press the "Control Key + r" and your command prompt is replaced with thisWhat linux distro are you running
A Distribution Query Howto
Here is a very quick and easy tip to find out what distribution of Linux your system is running, open a new terminal window and type the command below at your prompt. Please be aware #> is a prompt do not type this in your terminal window just the command You should get something like this #> lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 10.04 LTS Release: 10.04 Codename: lucidConverting filenames to lower case
Converting "Mixed Case" filenames to "Lower Case"
Command-Line-Fu
Just a head's up on a pretty cool site that I came across today: Command-Line-Fu
Empty Recycle Bin
Removing Deleted Files from your Trash
Have you ever deleted files to your "Recycle Bin" or if you prefer "Trash" only to find you cannot use "Empty Deleted Items" observing that permissions prevent you from deleting all the files or folders your bin contains.

