Tag Archives: find

how to split large files

you have a 16Gb usb flash drive, but formatted on FAT, so no really large files can be copied.
you can split the files using split.

mac os:
to split only one file:
split -b 1000m large_file.mkv
to split all files bigger than 4Gb

find . -name "*.ts" -size +4G -exec split -b 1000m {} {} \;
debian:
split -b 1000M large_file.mkv
The output will be files xaa, xab, xac, …

emptying huge log files with `find`

this will list the files:
find /var/log/ -name "*.log*" -size +10000000c -type f -exec ls -lh {} \;

this will empty the files:
find /var/log/ -name "*.log*" -size +10000000c -type f -exec sh -c '> $1' -- {} \;