fuxoft

files size v3

Jul 19th, 2022 (edited)
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. mkdir test
  2. mkdir test/empty1
  3. mkdir test/subdir
  4. mkdir test/subdir/empty2
  5. echo -n abcdefghijklmno > test/subdir/file2.txt
  6. echo -n abcdefghij > test/file1.txt
  7.  
  8. find test -type f -exec sh -c 'stat --format=%s "{}"'  \; | awk '{s+=$1} END {print s}'
  9.  
  10. rm -rf test
Add Comment
Please, Sign In to add comment