How to use a shell

How to use a shell

Posted by: sfm
Posted on: 2007-08-08 16:18:00

I have large number of files to move from one domain to another. It was suggested that I use mv in a shell to do that. I have never used a shell before and wondered if anyone can talk me through how to use a shell to do the task. Both domains are with Dreamhost and I use a Mac. Thanks for the help.

Re: How to use a shell

Posted by: anonymous2
Posted on: 2007-08-08 16:39:00

Here's a good starting point.

http://wiki.dreamhost.com/Shell

With a mac you can easily use a terminal and: ssh username@domain.tld to get started.

I'd think about cp -r instead of mv...

Re: How to use a shell

Posted by: sfm
Posted on: 2007-08-08 17:43:00

Thank you for the help. For my own knowledge, can you explain why you suggest cp -r instead of mv?

Re: How to use a shell

Posted by: anonymous2
Posted on: 2007-08-08 17:55:00

I just said I'd think about it.

If something doesn't work, or breaks mid-way, with copy the files are all still in the original location.
Permissions and ownership change to the copying user's.

If it's the same user in the from and to locations, then I'd probably use mv too, depending on how many files, and whether there's a recent .snapshot available as backup, or another backup.

mv is faster and does not use any more disk space; copy doubles the disk space used, at least temporarily.

cp (without -p) would change modification date-time to when copied; mv should preserve the originals...

User's choice.

Re: How to use a shell

Posted by: Lensman
Posted on: 2007-08-08 18:59:00

Also remember to watch out for handling of symoblic links if you have any. Chances are you do not have any unless you remember making them yourself!

Tags: shelldreamhostmv