Thursday, December 30, 2010

Recursively Remove .svn Directory and Files

Has it ever occurs to you that when you asked source code from your fellow developer, they will give you their whole workspace package including .svn files and you just want to delete these folders since you don't need it.

In that case, just quickly type in the following command so you have time to catch up for your coffee break with the above mentioned fellow developer.

rm -rf `find . -type d -name .svn`

Tuesday, June 22, 2010

Touch Files Modified Date Recursively in Unix

Sometimes you need to touch all your JSP files to current date so that your servlet container willing to re-compile your JSP again. It wouldn't be a problem if it's only one or two JSP files that you need to issue touch command.

When you need to touch a folder of JSPs recursively, the following command comes to your rescue

find jsp -exec touch {} \;

Saturday, April 10, 2010

View All Tables Record Counts in MySQL

To view all tables record counts in MySQL simply use this command

SELECT table_name, TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'database_name';

edit: it seems like the result returned is a cached result and it is not accurate, if you are looking for accurate result, I don't recommend the above mentioned approach.