Sunday, April 20, 2014

Useful linux command line

1. Find content in multiple files
grep -rnw "content" 
where : r is recursive, n is line number , w is the whole word.

grep -lir "content"
will show file names which contains the content.

2. Mysql command line
login: mysql -h localhost -u myname -pmypass mydb

3. Replace string in subfolder multiple files
find ./ -type f -exec sed -i -e 's/apple/orange/g' {} \;

No comments:

Post a Comment