Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Flatten a directory structure ' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Flatten a directory structure
Authored by: arcticmac on Feb 27, '13 09:53:23AM

An interesting side effect of using 'ln' instead of 'cp' (really, you want 'cp -n' if you're going to take that approach) is that ln makes hard links instead of copies. Effectively, you get another pointer to the file's data, rather than a whole new copy of the file. In many cases, this is an advantage because hard linking is faster than copying, and you won't need nearly as much disk space to make a bunch of new hard links. On the other hand, if you wanted to flatten and then make changes to the flattened copy while leaving the originals alone, you'd definitely want to use 'cp -n' instead.



[ Reply to This | # ]