0
votes
1answer
23 views

OS X: Copying only files without a special string in filename

I have to copy only files from a folder that don't have following string in its filename: NNNNxNNNN (a 3 or 4 digit number followed by the character x followed by a 3 or 4 digit number again -> it's ...
2
votes
1answer
101 views

Simple find and copy script for linux [closed]

I'm quite a newbie to scripts in Linux. What im trying to get is a simple script that finds a file by its exact name, then copy that file to a different folder. So Essentially it should work like ...
31
votes
4answers
27k views

How can I recursively copy files by file extension, preserving directory structure?

At the Linux command line, I'd like to copy a (very large) set of .txt files from one directory (and its subdirectories) to another. I need the directory structure to stay intact, and I need to ...
2
votes
1answer
80 views

bash script to compare dates within a diven dir (incl. subdirs)

I would like to write a bash script (or just use a command in the CLI) to find all the instances within a given directory and its subdirectories for a given time period copy those files into a ...
3
votes
5answers
14k views

Find document files and copy them to another directory

This is a bit of a basic question but I'm trying to copy all .doc files I find in a directory and copy them to another directory. I know each command: find -name '*.doc' . and: cp filename ...
0
votes
2answers
173 views

Copy a file from source directory to target base directory and maintain source path

Forgive me, I am probably not using the right terms to describe the problem and misunderstanding the most basic usage for a couple of common commands. I have a simple find statement that is ...
3
votes
2answers
1k views

How can I use sed to alter the results of find and pass the results to cp?

In solaris, I'd like to copy all files found by the find command to a slightly different path. The following script basically executes cp for each file found by find. For example: cp ...