Posts

Showing posts from 2015

Use rsync to copy a directory structure

To copy the directory structure only without copying any files: rsync -a -f"+ */" -f"- *" source destination/ If you don't put the trailing / on source you'll get the source directory created in destination. If you put the trailing / after source, you'll get all of the subdirectories of source created in destination without the top source directory. Source

Getting a list of databases from PostgreSQL at the command line

psql -Alxt|grep 'Name'|cut -d '|' -f 2