Welcome to bashoneliners.com, a curated collection of practical and well-explained Bash one-liners, snippets, tips and tricks. We aim to make each published one-liner to be of high quality: useful, easy to read, follows best practices, with clear, detailed, accurate explanation. These one-liners should help you automate tasks, troubleshoot problems, whether it be in system administration, file management, networking or programming.
git log --since='last month' --author="$(git config user.name)" --oneline
git grep -Ew '[A-Z0-9]{20}'
git ls-tree --full-tree -r --name-only HEAD | xargs egrep -w '[A-Z0-9]{20}'
git commit -m "$(w3m whatthecommit.com | head -n 1)"
git archive master some/project/subdir | tar t
find . -name .DS_Store -exec git rm --ignore-unmatch --cached {} +
git ls-files | xargs wc -l | awk -F ' +|\\.|/' '{ sumlines[$NF] += $2 } END { for (ext in sumlines) print ext, sumlines[ext] }'
git archive master | tar x -C /path/to/dir/to/export