if one executes the following two commands in one line, as follows,
rm -rf dir ; cp -r dir2 dir
it may complain that cp can not create directory dir/subdir: File exists
but if these two commands are executed in two lines, no errors will be thrown. I am just wandering what is the difference? and more importantly, how to execute two commands in one line, with the effect exactly the same as by two lines...
EDIT: I change it to cp -r dir2 dir. Besides, what is in dir or dir2 is huge, typically 4gb.

type -a rm cp. – Dennis Williamson Jul 20 '12 at 19:20type -a rm cpshowsrmis redirected torm -i, so ifcp– Richard Jul 20 '12 at 19:25cp: omitting directory `dir2'even when rm is not aliased. So, there's definitely something going on, but see solution below. – CodeGnome Jul 20 '12 at 19:27-ioption shouldn't cause the problem you're seeing. Is dir2 a symlink? That shouldn't matter, though. – Dennis Williamson Jul 20 '12 at 19:28diron an NFS mount, by any chance? I'm picturing the NFS client issuing thecprequest before the NFS server has finished deletingdir. No idea if that's plausible. – chepner Jul 20 '12 at 19:43