copy problem

15 views
Skip to first unread message

highs...@yahoo.de

unread,
Jan 28, 2021, 9:32:05 AM1/28/21
to LUG
Thank You for help.

Can I ask for more help?

How can I do this with the limit

copy all Textfiles a*.txt   created   20 June 2,014   to  23 July 2,015?

Thank You again.

Sophie



Am 26.01.21 um 15:02 schrieb Jeremiah Bess:
Not quite. Assuming you want to get all the a*.txt files recursively inside
the daten directory, this is the correct syntax:

cp -r date/a*txt backup

Jeremiah Bess


On Tue, Jan 26, 2021 at 1:32 AM 'highs...@yahoo.de' via Linux Users Group
<linuxus...@googlegroups.com> wrote:

cp -r a*.txt daten backup

hello
does this copy all files from hd to a new directory?

regards
Sophie

--
--
You received this message because you are subscribed to the Linux Users
Group.
To post a message, send email to linuxus...@googlegroups.com
To unsubscribe, send email to linuxusersgro...@googlegroups.com
For more options, visit our group at
http://groups.google.com/group/linuxusersgroup
References can be found at: http://goo.gl/anqri
Please remember to abide by our list rules (http://tinyurl.com/LUG-Rules)
---
You received this message because you are subscribed to the Google Groups
"Linux Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to linuxusersgro...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/linuxusersgroup/d3455c3b-0b0d-b1e1-7c27-9c2feebbb37e%40yahoo.de

.

frank

unread,
Jan 28, 2021, 11:18:38 PM1/28/21
to Linux Users Group

> copy all Textfiles a*.txt   created   20 June 2,014   to  23 July 2,015?

By using the find command as per this post

touch --date "2014-06-20" /tmp/start
touch --date "2015-07-23" /tmp/end
find [source_dir] -type f -name "a*.txt" -newer /tmp/start -not -newer /tmp/end -exec cp -p {} [target_dir];

HINT: Before running find with exec I always prefix command with "echo" as in:

find [source_dir] -type f -name "a*.txt" -newer /tmp/start -not -newer /tmp/end -exec echo cp -p {} [target_dir];

Reply all
Reply to author
Forward
0 new messages