Split number by groups with three digits 14 Apr 2016 $ ls /tmp -al -rw------- 1 user user 667030687 Apr 14 11:06 huge.log.gz groupnum() { perl -pe 's;(?<=\d)(\d{3})(?=(\d{3})*(\D|$));.$1;g;' } $ ls /tmp -al | groupnum -rw------- 1 user user 667.030.687 Apr 14 11:06 huge.log.gz