3 ms·
An even faster O(1) alternative ln -s /path/to/source /path/to/dest
by qolop 5y ago
An even faster O(1) alternative
ln -s /path/to/source /path/to/dest
- ViViDboarder 5y agoOr, even closer, drop the -s. That way deleting the source doesn’t delete the destination. That said, neither of these are truly the same as an edit to one will impact the other.
- 411111111111111 5y agoHe might've gotten confused by newer filesystems like btrfs which let you create links to files instantly which effectively work exactly like a copy. The second file however isn't actually created until a change has occurred, so the linking is only an entry in the catalog to the inodes i believe. i.e. btrfs snapshots use this feature.
- Klasiaster 5y agoThis can be enabled as available with the --reflink=auto flag for cp. When copying between different filesystems it still makes sense to add the --sparse=auto flag to keep a copy of a sparse file sparse, too. My alias for cp is: cp -i --reflink=auto --sparse=auto