Featured posts Show

I learned about hard links in *nix the other day and its changed my life.

Sometimes you want a file in more than one place so you copy it. Since we’re talking *nix you cp, rsync, cat > out, or whatever. But that is lame because now you’re storing the same data in two places. LAME!

If you came from windows this is when you say “oh, I can just make a shortcut!” but shortcuts are lame because they break all the time. There’s something better to do!

ln /somepath/file1 /somepath/file2

This is the link command. It will make the file appear in two places at once without actually copying the data. Delete file1 and file2 still exists, no data was actually deleted. The data won’t be deleted until you delete both file1 and file2.

Love it.

Posted Thursday, March 27, 2014