This page does not meet our wiki style guidelines. Please help improve this page by cleaning up its formatting. |
MarkEmptyDirsWithFind
This is how I do the most basic tasks that the MarkEmptyDirs tool can do but using the "find" command in GNU/Linux. Doing a shell script with this commands and adding some advanced functionality should be easy.
Use with caution.
Use cases
All examples must be run in our working project root directory or you must change the "find ." part with "find DIRECTORY".
Create placeholder files
find . -type d -not -path "*/.hg/*" -empty -exec touch {}/.emptydir \;
Update placeholder files
find . -type d -not -path "*/.hg/*" -not -empty -exec rm {}/.emptydir \; find . -type d -not -path "*/.hg/*" -empty -exec touch {}/.emptydir \;
Delete placeholder files
find . -type f -not -path "*/.hg/*" -name ".emptydir" -delete
List placeholder files
find . -type f -not -path "*/.hg/*" -name ".emptydir" -ls