I want to shred permanently and recursively, but sorting firstly numerically and then alphabetically. The command shredded in wrong order/sort, for example:

shred: ./browser/tabwidget/tabwidget.cpp: removing
shred: ./browser/tabwidget/tabbar.cpp: removing
shred: ./browser/tabwidget/horizontallistwidget.h: removed
shred: ./browser/tabwidget/docktitlebarwidget.h: removed

My commands are:

find . -type f -print0 | sort | xargs -0 shred -uvz -n 3
find . -type f -print0 | xargs -0 shred -uvz -n 3 | sort
find . -type f -print0 | xargs -0 | sort | shred -uvz -n 3
find . -type f | sort | -print0 | xargs -0 shred -uvz -n 3

sort $(find . -type f -print0 | xargs -0 shred -uvz -n 3)
  • 1
    Your first command looks like it would work if your sort was also null delimited (e.g. sort -z on a GNU system) – steeldriver Oct 22 '19 at 23:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.