{h1: Lets have a {em: quick bash}} I wrote a quick reference for doing common things in bash, particularly for those things that I'm always forgetting. {h1: Save the output of a command as a file:} {pre: $ ls *.txt > /path/to/file} {h1: Append the output of a command to a file:} {pre: $ echo 'Test.' >> /path/to/file} {h1: Get a list hidden files:} {pre: $ ls -A} {h1: Get a list only hidden files:} {pre: $ ls -d .??*} {h1: Get word count statistics:} {pre: $ wc -l < /path/to/file} {h2: Flags for {code: wc}:} {dl: {dt: -l} {dd: Count lines} {dt: -w} {dd: Count words} {dt: -c} {dd: Count characters} } {h1: Compress a directory:} {pre: $ tar -cj directory > archive.tar.bz2} {h1: Extract an archive:} {pre: $ tar -xj < archive.tar.bz2} {h2: Flags for {code: tar}:} {dl: {dt: -j} {dd: Compress with bzip2 (.bz2)} {dt: -z} {dd: Compress with gzip (.gz)} {dt: -v} {dd: Show progress messages} } {h1: Download a file over ftp or http:} {pre: $ wget http://domain/path/to/file OR $ curl http://domain/path/to/file -o /path/to/output/file}