Hosting Tips & Tricks

Posts Tagged ‘bash’

Use the vi editor binary mode to remove control-m characters

If you’ve ever opened a text file with vi (or vim) and saw a message on the bottom of the screen that says “dos” or “dos format”, there’s a reason for this. The file was probably created on a DOS or Windows computer, and it contains extra binary characters that are not normally found in [...]


Bash tips & tricks

I know that bash is not really a scripting language (I like perl ) but there are times when you just want to do things on a single command line.
So, if you want for example drop some databases from a folder list:
ls /var/lib/mysql | grep dbmatch* | while read i; do echo “drop database $i”; [...]