Blog of roxlu, co-founder of Apollo Media. Contact info[shift+2]apollomedia.nl.

Handy Bash Commands

From time to time I google for bash commands that ease some of the repetitive tasks of a developer. I created this page as to bundle all the commands that I've used and find handy to keep in one place.

Rename whitespace by underscode (tested on Mac)

for f in *\ *; do mv "$f" "${f// /_}"; done

`

Lowercase all filenames in a directory

for i in *; do mv "$i" "$(echo $i|tr A-Z a-z)"; done

Create a tar.gz from files that have changed since a day

find . -mtime -1 -type f -exec tar -rvf assets.tar.gz {} \;