Batch replace text in big files
For example: Change Collation in a big database dump.
cat dumpname | sed s/CHARSET=utf8/CHARSET=utf8\ COLLATE=utf8_unicode_ci/ > neuer_dumpname
For example: Change Collation in a big database dump.
cat dumpname | sed s/CHARSET=utf8/CHARSET=utf8\ COLLATE=utf8_unicode_ci/ > neuer_dumpname
mogrify -format jpg -resize "800x500>" *
$ sed '/WORD1/,/WORD2/d' input.txt > output.txt
We were looking for a way to create mysqldumps which contained all the structures for the tables, but the data only for part of the tables.
nawk '/CREATE DATABASE \/\*\!32312 IF NOT EXISTS\*\/ \`%DB-NAME%\`/,$0 ~ /CREATE DATABASE/ && $0 !~ /%DB-NAME%/' DUMPFILE > DUMP_DB
Find first occurence of 'splitword' in file:
grep -n "splitword" bigdumpfile.sql | head -1 | cut -d : -f 1
Result is: 86948
Save partial dump:
cd into the directory you want to check
find -type l -exec ls -l {} \;
SELECT a.nid, b.nid FROM node AS a , node AS b WHERE a.nid = 13 AND b.nid !=14 AND b.nid !=15 ORDER BY RAND() LIMIT 3