Unix commands


mysqldump

Usage: mysqldump -u -p [OPTION] [database]

--add-drop-table Add a DROP TABLE statement
before each CREATE TABLE statement.
--add-drop-database Add a DROP DATABASE statement
before each CREATE DATABASE statement.
--add-locks Surround each table dump with
LOCK TABLES and UNLOCK TABLES statements.
This results in faster inserts
when the dump file is reloaded.
--all-databases Dump all tables in all databases
--compress Compress all information sent
between the client and the server if both
support compression.
--extended-insert Use multiple-row INSERT syntax
that include several VALUES lists. This
results in a smaller dump file and
speeds up inserts when the file is reloaded.
--no-data Do not write any row information
for the table. This is very useful if
you want to get a dump of only the
structure for a table.
--quick This option is useful for dumping
large tables. It forces mysqldump to
retrieve rows for a table from the
server a row at a time rather than retrieving
the entire row set and buffering
it in memory before writing it out.

rsync

Usage: rsync [OPTION] SRC DEST

--verbose increase verbosity
-a, --archive archive mode
-n, --dry-run show what would have been transferred
--existing only update files that already exist
--ignore-existing ignore files that already exist on the receiving side
--delete delete files that don't exist on the sending side
--delete-after delete after transferring, not before
--max-delete=NUM don't delete more than NUM files
--size-only only use file size when determining if a file should
be transferred
-z, --compress compress file data
--exclude=PATTERN exclude files matching PATTERN
--progress show progress during transfer

Example use:

$ rsync --archive --size-only --compress --progress server:/path localpath
$ rsync --archive --size-only --compress --progress local/path server:/path

Other

Search and replace

$ sed -n 's/search/replace/gpw output' file.txt