[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] [Raq4] how move a whole dir with subdirs to another dir ?
- Subject: Re: [cobalt-users] [Raq4] how move a whole dir with subdirs to another dir ?
- From: flash22@xxxxxxx
- Date: Sat Sep 15 13:52:05 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
On Sat, 15 Sep 2001, bob lenaerts wrote:
> Hi,
>
> Ik now this has nothing to do with cobalts, but I do not seem to know
> the unix command, to MOVE a whole directory WITH subdirs to another
> directory.
> Can anyone help me ?
> Move or copy, I don't care :-)
>
> mv -R dir/ /home/sites/www.domain.be/web/ does not seem to work :(
It's close, when you are moving a single directory in place, you do not
need the -R, you are moving the directory itself, everything inside it
inherently goes along for the ride...
mv somedir /path/to/where/it/goes/
Note , no slash on the source dir, that will sometimes bite you, bad
habit, also the above assumes you are in the directory the folder that you
are moving is in, and last , but not least, if the source and destination
are not on the same physical disk partition, the system will in fact copy
and delete instead of moving, this can take quite a while if there are a
lot of files....recalculating quota will also take a while, the point is,
don't panic and ^c it, or you will likely make a mess ;)
tip: mv treats files and directories exactly the same when they are the
source name(s),it only differentiates on the last, destination name, which
will determine if mv is renaming(it's a file) or moveing(it's a directory)
caveat: on some machines, including some linux versions, if you mv a file
to a file, but the target file is a directory, *all* the files in the
target directory will be destroyed!! (The target directory is deleted and
replaced with the file) *never* use mv as root unless you
actually HAVE to ;)
gsh