I'm looking for a single linux command that allows me to do the equivalent of this:
cp /some/path/file /another/path/ && ln -sf /another/path/file /some/path/
If there isn't one, what's the best way to do this for a bunch of files?
I'm looking for a single linux command that allows me to do the equivalent of this:
cp /some/path/file /another/path/ && ln -sf /another/path/file /some/path/
If there isn't one, what's the best way to do this for a bunch of files?
A small note, is that you could use ln both times to make the command not actually move the data (assuming both paths are on the same filesystem).
But I assume that you want to move the content of /some/path/ to an other disk, and then create links to the new files so "no one" notices.
Wrapping it in a bash function:
Theres my script you could use (takes two parameters /some/path/file and /another/path/ ):
Seriously, I thought this was a really easy question.
Here's what I can do in perl:
I was hoping for something more elegant, but I guess I'll use that.