"mv" vs. "cp"
Posted on 1999-07-09
I'm modifying a production script thinking of replacing a command with "mv". The original command was to do a "cp" of a file, then run "cmp" and "cksum" to ensure the two copies are the same then do a "rm" of the original file. Due to the new requirement I would like to retain the original timestamp of the file and I could only think of using the "mv" command instead.
Should I be worry about by-passing all the parity checking??
Does "mv" also doing a "cp"+"delete" in the background or does it only move the soft-pointer of the file??
If I don't use the "mv" command, are there any other ways to
relocate a file but retaining its timestamp??