Tag Info

New answers tagged


The "slackspace" you're referring to is often called sparse space within a file. You can use the ls & du commands to detect how much sparse space a give file is consuming. excerpt from Wikipedia's Sparse File Detection The -s option of the ls command shows the occupied space in blocks, and -k the apparent size in blocks too: $ ls -lks ...


The best I could come up with so far is (ksh93, using filefrag from e2fsprogs 1.42.9 (some older versions have a different API), on extent based file systems on Linux): #! /bin/ksh93 export LC_ALL=C for file do filefrag -vb1 -- "$file" | while IFS=": ." read -A a; do [[ $a = +([0-9]) ]] && [[ ${a[@]} != *unwritten* ]] && command ...

Top 50 recent answers are included