unix

MySQL Quick Backup

  • View
  • Edit
  • Delete
Situation: 
this function creates a demoDB.sql file of demoDB Database. The path may change according to your setup.


function dump_db {
/usr/local/mysql/bin/mysqldump -u root -p $1 > $1.sql
}


Browse thru bash_history

  • View
  • Edit
  • Delete
Situation: 
This script just browses through the .bash_history file. It displays the commands that match the keyword you type as argument.


function browse_history {
cat ~/.bash_history | grep $1
}


Powered by Drupal, an open source content management system