Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5
Posts: 223
Rep:
move files between file systems
Hi
I have to move files between two file systems /inst and /inst2.
When I perform 'cp -a /inst /inst2' it copies everything even hidden files and preserves access permissions.
But when I perform 'mv /inst /inst2' it also preserves access perms and moves everything besides hidden files.
Questions :
------------
Why is so ?
What tool to use when moving file systems from one fs to another (rsync) ?
Well mv should also move the hidden files because you are moving the folder. It is not possible that it is not moving the hidden files.
I have just tried moving mv /home/test /root/ and it does moves the hidden files.
rsync is something different it is usually used for backup purpose. For example you have set up /backup directory to backup your file system data.
If you set up a script to run rsync to copy the data from /test to /backup it will copy only copy the difference.
Suppose /test is your live directory which changes everyday by the users and they save their work their and on /backup you already have this directory backed up before. Then rsync will only copy over the difference that is there on /test and /backup.
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5
Posts: 223
Original Poster
Rep:
There is no problem when I use 'mv /inst /inst2'.
Then it copies everything perfectly but i have inst directory inside of inst2 directory.
I would like to move only content on inst dir into inst2 dir.
When I perform 'mv /inst/* /inst2' or 'mv /inst /inst2' it copies everything apart hidden files.
How to move only content of /inst dir also with hidden files ?
Last edited by drManhattan; 04-29-2011 at 04:15 PM.
That is because there is either no file with the extension or no file with the name (without name file .bashrc). Linux interpret .bashrc as .bashrc extension.
You have to try that command accordingly. For example if in a directory you have following types of file:
Scenario 1:
1. /test contains only name.txt files then run mv -v /test/*.* /destination_partition/destination_folder.
Scenario 2:
2. /test contains only .extension files (like .bashrc) run mv -v /test/.* /destination_partition/destination_folder.
Scenario 3:
3. /test contains both files .extension and name.txt files run mv -v /test/*.* /destination_partition/destination_folder && mv -v /test/.* /destination_partition/destination_folder
I have added -v so that you can see the progress.
Last edited by T3RM1NVT0R; 04-29-2011 at 06:05 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.