Hello, with the increasing support for copy-on-write (i.e. reflink) in modern filesystems, it seems reasonable for head(1) and tail(1) to try calling ioctl_ficlonerange(2) where available before copying.
This way, a user can perform the following sequence of commands in bash to obtain a single combined file without any copying: head -n 123 first-file > combined-file head -n 456 second-file >> combined-file tail -n 789 third-file >> combined-file At first, I considered creating a separate tool for this use case, which would be called in the following manner: reftk A=first-file B=second-file C=third-file cat A1-123 B1-456 C=789 output combined-file Then it dawned on me that this is perhaps something coreutils should be able to do. If you think this feature request is sound, I can provide the patches. Best Regards, Vit Novotny
Description: PGP signature