How to use a shell


#1

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.


#2

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…

[color=#00CC00]ANONYMOUS0=>Max Discount[/color] [color=#6600CC]ANONYMOUS2=>Max - $1.[/color] Being mean doesn’t make you look smarter than him. And bigoted remarks are not appreciated on this forum.


#3

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


#4

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.

[color=#00CC00]ANONYMOUS0=>Max Discount[/color] [color=#6600CC]ANONYMOUS2=>Max - $1.[/color] Being mean doesn’t make you look smarter than him. And bigoted remarks are not appreciated on this forum.


#5

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!

Free unique IP and $67 off with promo code [color=#CC0000]FLENSFREEIP67[/color] or use [color=#CC0000]FLENS97[/color] for $97 off. Click here for more options