Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy flies on OSX using hard links

Status
Not open for further replies.

nerbonne

Technical User
Dec 11, 2006
99
US
I'm pretty sure that on Linux I used to be able to copy files and directories using "cp -al dir1 dir2" to make a copy of the directory that only updated the file count but didn't take up any more space on the disk.

However, on OSX Snow Leopard, the cp arguments are way different and this doesn't work. Can anyone tell me how to make copies of entire directories but not use more space on the disk?
 
The basic command for creating a hard link is the ln command, but that only works on single files.

A shell script using this and the find command could be used to hard-link a directory structure.

Or you could try apropos copy to see what other commands mention copy.


--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
man cpio

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top