Here's a fun exercise for people learning #Linux
-
Here's a fun exercise for people learning #Linux:
Do you know the difference between what happens when you run these commands?
cp
ln
ln -s -
8Bit | :linux: :godot: | 🍶🦊replied to Scott Williams 🐧 last edited by
@vwbusguy come to think of it, I don't think I ever really understood the difference between a hard- and soft-link. Looking online, I see there is a technical difference... but is there a practical one?
-
pinoreplied to 8Bit | :linux: :godot: | 🍶🦊 last edited by
@memoriesin8bit @vwbusguy One practical difference: You can remove your original file, but the hard link still keeps your file. Your symbolic link will just be dangling. This is why e.g. you cannot make hard links across filesystem boundaries.
-
@pino @memoriesin8bit @vwbusguy Yes. For example, there’s a cool feature of rsync where you can give it a reference folder in addition to the source and destination, and any file that’s identical in the source and reference will be created as a hard link in the destination. This way, both the reference and the destination end up being full copies of the source (but at different points in time,) without taking double the disk space. This is leveraged by rsnapshot for incremental backups.
-
@oscherler @pino @memoriesin8bit Yup, a neat dedup trick as long as you can tolerate writes to one being writes to all, but you're probably not going to be hand editing your backup files.