Bash scripting

Force fsck on next reboot

July 19, 2010
By silviu
fsck

Let’s say you run a headless server and you want to fsck the main partition. The easy solution in this case is (if possible) to force fsck to run on the next boot. If you run slackware than all you really need is to create an empty file in /etc called forcefsck You could...
Read more »

Tags: , , ,
Posted in Bash scripting, Tips and tricks | No Comments »

Wma to Mp3 a folder in one command line

June 29, 2010
By silviu

I have some albums that were ripped in wma form (yes a shame I know). I wanted them converted into mp3 so my collection remains consistent. So this would be a command to run in a folder filled with .wma files. This keeps the names but not the tags so be sure to use...
Read more »

Posted in Bash scripting, Tips and tricks | No Comments »

Easily send mail from a bash script

March 18, 2010
By silviu

Did you ever need to have e-mail's sent from within a bash script? Maybe alert you of errors encountered? Me too. Here's an easy way on how to do it:
Read more »

Tags: , , , , ,
Posted in Bash scripting | No Comments »

Rename all files in a folder from upper to lower case.

February 12, 2010
By silviu

Sometimes is needed to have all files in a folder in the same case. Here’s a small script to rename all files in the folder to lower case: for i in *; do mv $i `echo $i | tr [:upper:] [:lower:]`; done
Read more »

Tags: , , ,
Posted in Bash scripting | No Comments »

Export a MySQL database using the command line.

February 2, 2010
By silviu
logo-mysql-110x57

Sometimes it’s easier to just drop to the command line then browse for fancy tools like phpMyAdmin. This is useful, especially for quick jobs. mysqldump -u user -ppassword your_database > database_backup.sql Of course you need to replace: user – mysql username password – the password your_database – the database you want to backup Adding...
Read more »

Tags: , , ,
Posted in Bash scripting | No Comments »

Checking directory sizes from the BASH prompt

January 18, 2010
By silviu
bash_script

The command ls can be made to show directories and permission but it will not display directory sizes. Then it’s time for other commands. For example on my hosting account there is no file manager installed and evidently x and kde is missing too so, to find out directory sizes I can use the...
Read more »

Tags: , , , ,
Posted in Bash scripting, Tips and tricks | No Comments »

Website personal

Daca sunteti interesati de activitatea mea personala sau serviciile oferite acesta este site-ul pe care doriti sa-l vizitatiro.sgvulcan.com

Follow me:

Subscribe via RSS Subscribe via Email