Archive

Archive for the ‘linux’ Category

diff files recursively in different directories

August 29, 2008 varnit Leave a comment

for i in `find . -type f | grep -v CVS`; do diff $i ${i/./~/dev_stage/websites/www/v2/share/htdocs};done;

Categories: linux

Recursively add files to cvs

April 30, 2008 varnit Leave a comment

Let say we have the following directory structure

  • project
    • one
    • two
  1. add the root directory (project) 

    cvs add project 

  2. cvs ci project
  3. cd project
  4. find all directories

    find . -type d -print | grep -v CVS | xargs cvs add

  5. cvs ci
  6. find all files other than CVS and .

    find . -type f -print | grep -v CVS | grep “^\.\/” |xargs cvs add

  7. cvs ci
Categories: cvs, linux

vim cursor key navigation

March 12, 2008 varnit Leave a comment

set term=linux

Categories: linux, vim

bash for loop through numbers

March 3, 2008 varnit 1 comment

# for i in `seq 1 10`; do mysql -uusername -ppassword database_name -e “SELECT COUNT(*) FROM table$i”;done;

Categories: bash, linux Tags: , ,

bash for loop through text

March 3, 2008 varnit Leave a comment

# for i in `echo “table1 table2 table3″`; do mysql -uusername -ppassword database_name -e “SELECT COUNT(*) FROM $i”;done;

Categories: bash, linux