dd if=/dev/zero of=/dev/hda bs=65535
|
|
|
|
dd if=/dev/zero of=/dev/hda bs=65535 sudo badblocks -vs /dev/hda1 The script assumes that the database is on localhost, that the user is “root” and that no password is required. Please adjust it otherwise in the script. #!/bin/bash # This script searches in a database named $1 for a string $2 # usage example: ./search_through_database.sh “database_name” “string” # TODO: check the parameters database=$1 string=$2 query=”show [...] Use “grep”: grep -rsinH –include={pattern} “{searchphrase}” {file_or_directory} For example: grep -rsinH –include=*.txt “searchphrase” ./ “rsinH” is equal to: –recursive –no-messages –ignore-case –line-number –with-filenames As an alternative you can use grep in combination with find: for f in $(find . -name *.txt); do grep -sinH “{searchphrase}” $f; done; ssh -T {user}@{host} tar -c {source_directory} | tar -C {target_directory} -xpv mysqldump –opt –host={213.211.111.11} –user=’{username}’ –password=’{password}’ –database {db_name} > {path/to/file/filename.sql} Export a mysql database to a file: mysqldump -u {database_username} -p {database_password} {database_name} > {filename}.sql Read in a database export: mysql -u {database_username} -p {database_password} {database_name} < {filename}.sql |
|
|
Creative Commons licensed 2012 ma.juii.net - Some Rights Reserved | Posts Feed Powered by WordPress & Atahualpa |
|