![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| List files created before Noon 2 days prior | prismtx | Shell Programming and Scripting | 3 | 01-19-2008 12:06 PM |
| ls latest 4 days or specify days of files in the directory | happyv | Shell Programming and Scripting | 3 | 01-22-2007 07:16 AM |
| How to delete files over 30 days | GEBRAUN | UNIX for Dummies Questions & Answers | 2 | 01-25-2006 01:58 AM |
| tar files older than 30 days | wfch | UNIX for Dummies Questions & Answers | 6 | 04-19-2004 04:40 AM |
| removing files that are 60 days old | aojmoj | Shell Programming and Scripting | 5 | 01-26-2004 02:45 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
moving files prior to 2 days
Hi All,
I have a question. i have a directory say /home/pavi/logs ls -ltr gives all the files in the /home/pavi/logs directory. i am trying to move only those files existing in this folder prior to 2 days. i.e files exiting say May 9th and May 8th remain in this directory but all the remaining files should be moved to a destination dir say /hom/pavi can anyone please suggest me with some ideas. thanks pavi |
|
||||
|
When I use this for my script I get a bunch of errors. I thought I could use Xargs but I get this:
usage: mv [-f | -i | -n] [-v] source target mv [-f | -i | -n] [-v] source ... directory Here's my code: find /home/pavi/logs/ -mtime +21 -exec ls {} \; | xargs mv /home/pavi Any thoughts? Thanks. |
|
||||
|
Please post exactly what you are typing to move the files.
Try to Copy or make changes to the paths and execute the command below and it should move the files older than 2 days old. mv `find /home/pavi/logs/*.* -mtime +2 -exec ls {} \;` /home/pavi |
|
||||
|
Hi,
This will help u what i did is to cd inside that area from where i want the results and create a folder log.bkup and move all file more than 7 days into that folder find . -mtime +7 -exec mv {} log.bkup \; |
![]() |
| Bookmarks |
| Tags |
| mtime |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|