Moving 2 months of old files from a folder to another folder.
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Moving 2 months of old files from a folder to another folder.
I need to move huge list of files from april to june to a folder. I need to move without touching July files. Need some help on this. I have used find command.
find . -type f -m time +60 -exec mv /old/files {} \;
Actually all the april, may, june files are placed in a single folder. There are many folders as well. Only way to distinguish April, May, June files is used date right.. Its a mix of all the months from april - july 11. I need to move all the files except july files to a new folder. Also we need to specify the target location after mv right
find /home/user/Downloads/ -type f -mtime +60 -exec mv /mnt/test {} \; Is this correct.. to move last 60 days of files to /mnt/test... Or would it be simple to move files from april to june alone. What i meant is instead of specifying last 60 days, is there an option to spcecify files from june n april alone
Well, the time format might change due to the setting of locale so that it’s no longer $9 and piping looks lengthy. This can still be put into one find command I think. What problem did you face with the find command? And what does the cut command – splitting the file name at a colon, so that it’s no longer a valid filename?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.