User Tools

Site Tools


bash:directories:empty_all_files_in_a_directory

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

bash:directories:empty_all_files_in_a_directory [2021/07/07 15:41] – created peterbash:directories:empty_all_files_in_a_directory [2021/07/07 15:42] (current) peter
Line 4: Line 4:
 find . -name "*.dat" -type f -exec cp /dev/null {} \; find . -name "*.dat" -type f -exec cp /dev/null {} \;
 </code> </code>
 +
 +----
 +
 +===== Delete all files in the directory =====
 +
 +<code bash>
 +find . -name '*.dat' -type f | xargs rm
 +</code>
 +
 +
bash/directories/empty_all_files_in_a_directory.1625672511.txt.gz · Last modified: 2021/07/07 15:41 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki