====== BASH - Directories - Empty all files in a directory ====== find . -name "*.dat" -type f -exec cp /dev/null {} \; ---- ===== Delete all files in the directory ===== find . -name '*.dat' -type f | xargs rm
find . -name "*.dat" -type f -exec cp /dev/null {} \;
find . -name '*.dat' -type f | xargs rm