Results 1 to 9 of 9
-
04-01-2008, 05:29 PM #1Web Hosting Evangelist
- Join Date
- Apr 2006
- Posts
- 516
How do I Move Files & Subdir (without changing Chown & Chmod)
As title:
How do I Move Files & Sub directory without changing Chown & Chmod them?
Situation:
I need to move /home/user/public_html/blog (all files & subdir) into /home/user/public_html
-
04-01-2008, 09:58 PM #2Hosting Systems Specialist
- Join Date
- Dec 2003
- Location
- New Zealand
- Posts
- 1,265
Are you moving between accounts?
or just moving everything back to public_html?
You don't move files via chown & chmod. ( chown - change ownership chmod - change permissions )
You can move files via command mv or copy the files via cp.
I hope this helps, you haven't explained much
Best Regards,
SSANZ
-
04-01-2008, 10:19 PM #3Web Hosting Evangelist
- Join Date
- Apr 2006
- Posts
- 516
As said, I need to move /home/user/public_html/blog (all files & subdir) into /home/user/public_html
I'm not sure mv is the correct command. It would rename instead.
/blog/subfolder1
/blog/subfolder2
/blog/subfolder3
/blog/subfolder4
/blog/dozens of files here
I can use cp for the files
If I use mv I need to do it one by one (for subfolders), and then it will change ownership to root:root and permission to default permission, some folders are 777
How do I do it the correct way?
-
04-01-2008, 10:47 PM #4Junior Guru Wannabe
- Join Date
- Mar 2008
- Posts
- 47
mv won't change permissions and ownership for your folders. You don't need to copy folders and files one by one. You can use the -i option and it will ask you before overwriting the files and folders.
cd /home/user/public_html/blog/;
mv -i * ../;
You can also use cp if you want to copy files from /home/user/public_html/blog to /home/user/public_html with the option -a so that permissions and ownership would not be changed.
cd /home/user/public_html/blog/;
cp -a * ../;GlowHost.com - Your fully managed, dedicated server specialists.
>> FFmpeg Web Hosting - Video Sharing and Social Networking web sites
>>> SHOUTcast Servers - 128k - Unlimited Users - Radio Control Panel
>>>> 99.9% Uptime Guarantee - 60 day risk free money back - 24/7/365 Support
-
04-01-2008, 10:59 PM #5Disabled
- Join Date
- Mar 2008
- Posts
- 102
you can even move by using VZPP panel.
-
04-02-2008, 12:21 AM #6Junior Guru Wannabe
- Join Date
- Oct 2005
- Posts
- 41
just type the below
mv /home/user/public_html/blog/* /home/user/public_html
this will move everything from blog to public_htmlWeb Hosting Gurus
-
04-02-2008, 01:30 AM #7Junior Guru Wannabe
- Join Date
- Mar 2008
- Posts
- 83
mv can be used to MOVE files and to RENAME files. depending on the commands you type.
<- myusername dot com is not a link to sites or images containing pornography, sexually explicit, gross violence, warez etc.
-
04-02-2008, 03:44 AM #8Web Hosting Evangelist
- Join Date
- Apr 2006
- Posts
- 516
-
04-02-2008, 06:18 AM #9Junior Guru Wannabe
- Join Date
- Mar 2008
- Posts
- 47
GlowHost.com - Your fully managed, dedicated server specialists.
>> FFmpeg Web Hosting - Video Sharing and Social Networking web sites
>>> SHOUTcast Servers - 128k - Unlimited Users - Radio Control Panel
>>>> 99.9% Uptime Guarantee - 60 day risk free money back - 24/7/365 Support