LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 12-07-2018, 10:40 PM   #1
AZFXDC
LQ Newbie
 
Registered: Dec 2018
Posts: 7

Rep: Reputation: Disabled
Question Trouble with find and mv


OK,
Sorry to have to ask...I tried to delete this from the newbie thread but don't see where...

I am trying to move files and directories older than 'x' days from source to destination


For instance, if I have files and directories in:
/home/username/temp/
that are older than 20 days

and want to mv them to:
/home/username/OK

I am trying:

Code:
find /home/username/temp -maxdepth 4 -mtime +20 -exec mv "{}" /home/username/OK/ \;
When I run the above line, /home/username/temp no longer exists...

What am I doing wrong?
Thanks in advance, I apprecaite any help.
-AZFXDC
 
Old 12-07-2018, 10:49 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being marked for closure because it is a duplicate.

Please continue the conversation here.
 
Old 12-07-2018, 10:51 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Change the mv to echo "{}" - see the problem ?.
 
Old 12-07-2018, 11:46 PM   #4
AZFXDC
LQ Newbie
 
Registered: Dec 2018
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Change the mv to echo "{}" - see the problem ?.
I'm afraid that I don't see... but I've been asked to continue in my initial thread. Sorry for the confusion.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find and replace where the find is on two lines and replace on first line andrew777 Linux - General 9 08-05-2013 01:50 PM
[SOLVED] Trouble with find's ls and non-english filenames yars Linux - Newbie 5 05-02-2012 04:03 PM
having trouble with ls and find finding files. dr_zayus69 Linux - Software 4 05-26-2005 10:36 AM
trouble ahead, trouble behind....trouble with mplayer Goonie Linux - Software 3 07-02-2003 02:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration