bashoneliners.com

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.

Recursively remove all empty sub-directories from a directory tree

find . -depth  -type d  -empty -exec rmdir {} \;

January 31, 2012openiduser16

Recursively remove all empty sub-directories from a directory tree

find . -type d | tac | xargs rmdir 2>/dev/null

November 29, 2011bashoneliners