Concatenate bash commands with arguments (xargs)
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.
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 {} \;
ZBsp: Collation in dump ändern
cat dumpname | sed s/CHARSET=utf8/CHARSET=utf8\ COLLATE=utf8_unicode_ci/ > new_dumpname
mysqldump -uUSER -pPASSWD --allow-keywords --opt DB | gzip > DB.sql.gz
Um eine Verbindung bzw. einen Port zu testen:
$user: telnet IP 80 für Webserver, $user: telnet IP 21 für FTP
chgrp - Gruppenzugehörigkeit ändern; Aufruf: chgrp gruppe datei
cat - Inhalt von Dateien ausgeben
mkdir - Verzeichnis anlegen
diff -up original.php new.php > filename.patch
Schnellere Methode:
gunzip -c datenbankdumpdatei.swl.gz | mysql -u admin -p datenbank_name
Langsamere Methode: