Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting Recursively copy only specific files from a directory tree Post 302156172 by Perderabo on Monday 7th of January 2008 01:16:24 PM
Old 01-07-2008
There is a command called rsync that can do what you want. I would try to use that.

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read from fileList.txt, copy files from directory tree

Hi, hopefully this is a fairly simple Q&A. I have a clean file list of approximately 180 filenames with no directory or slashes in front of the filename nor any extension or dot ".". I would like to read from this list, find these files recursively down through directory trees, copy the files... (1 Reply)
Discussion started by: fxvisions
1 Replies

2. UNIX for Dummies Questions & Answers

How to copy a tree of directory

Mi question is how can you copy only de three of directory and not the files in it. Only a need the three of directorys not the files (6 Replies)
Discussion started by: enkei17
6 Replies

3. UNIX for Dummies Questions & Answers

Copy directory tree with files

Iam in the process of copying a directory with thousands of directories and files into a new directory. I need to preserve permissions, owner, group, date and timestamps, everything. Iam using AIX and would need help of writing the command whether it is cp-RP or cpio. Apprecaite your... (3 Replies)
Discussion started by: baanprog
3 Replies

4. Shell Programming and Scripting

Delete all files with specific extension in directory tree

I'm sure this has been asked many times, but a search didn't turn up a definitive best method for this (if there ever is such a thing). I have been using rsync to back up my main data directory, but I have accumulated a large number of older backups that I don't need. All of the files I don't... (14 Replies)
Discussion started by: LMHmedchem
14 Replies

5. Shell Programming and Scripting

How to copy a directory without specific files?

Hi I need to copy a huge directory with thousands of files onto another directory but without *.WMV files (and without *.wmv - perhaps we need to use *.). Pls advise how can I do that. Thanks (17 Replies)
Discussion started by: reddyr
17 Replies

6. Shell Programming and Scripting

How to recursively copy directory only for recent files?

I love the -newerct flag for the Cygwin find command on windows. Can I use "/usr/bin/find . -newerct '3 hours ago'" to conditionally copy a directory tree so that only the files in the directory tree that are younger than 3 hours are copied to my destination directory such that the directory... (4 Replies)
Discussion started by: siegfried
4 Replies

7. Shell Programming and Scripting

Find Large Files Recursively From Specific Directory

Hi. I found many scripts in the web of achieving this. But I like to use this one find /EDWH-DMT03 -xdev -size +10000 -exec ls -la {} \;|sort -n -k 5 > LARGE.rst But the problem is, why it still list out files with 89 bytes as the output? Is there anything wrong with the command? My... (7 Replies)
Discussion started by: aimy
7 Replies

8. Shell Programming and Scripting

Rsync to copy specific subfolders and files to new directory

RootFolderI: RootFolderI/FolderA/Subfolder1/Subsub1/JPG1.jpg -> want this jpg RootFolderI/FolderA/Subfolder2/Subsub1/JPG2.jpg -> want this jpg RootFolderI/FolderA/Subfolder2/Subsub2/JPG3.jpg . . . RootFolderI/FolderB/Subfolder1/Subsub1/JPG4.jpg -> want this jpg ... (1 Reply)
Discussion started by: blocnt
1 Replies

9. Shell Programming and Scripting

Copy Specific Files Recursively

Is it possible to only copy selected files+its directories when you are copying recursively? find /OriginalFolder/* -type -d \{ -mtime 1 -o -mtime 2 \ } -exec cp -R {} /CopyTo/'hostname'__CopyTo/ \; -print From the above line, I want to only copy *txt and *ini files from /OriginalFolder/* ... (4 Replies)
Discussion started by: apacheLinux
4 Replies

10. Shell Programming and Scripting

Copy files recursively to one single directory

I need to copy a complete directory structure into a new location. But I want to have all files copied into one directory and leave out the directory structure. So all files must be placed in one directory. (4 Replies)
Discussion started by: ReneVL
4 Replies
LNDIR(1)						      General Commands Manual							  LNDIR(1)

lndir - create a shadow directory of symbolic links to another directory tree SYNOPSIS
lndir [ -silent ] [ -ignorelinks ] [ -withrevinfo ] fromdir [ todir ] DESCRIPTION
The lndir program makes a shadow copy todir of a directory tree fromdir, except that the shadow is not populated with real files but instead with symbolic links pointing at the real files in the fromdir directory tree. This is usually useful for maintaining source code for different machine architectures. You create a shadow directory containing links to the real source, which you will have usually mounted from a remote machine. You can build in the shadow tree, and the object files will be in the shadow directory, while the source files in the shadow directory are just symlinks to the real files. This scheme has the advantage that if you update the source, you need not propagate the change to the other architectures by hand, since all source in all shadow directories are symlinks to the real thing: just cd to the shadow directory and recompile away. The todir argument is optional and defaults to the current directory. The fromdir argument may be relative (e.g., ../src) and is relative to todir (not the current directory). Note that BitKeeper, CVS, CVS.adm, .git, .hg, RCS, SCCS, and .svn directories are shadowed only if the -withrevinfo flag is specified. Files with names ending in ~ are never shadowed. If you add files, simply run lndir again. New files will be silently added. Old files will be checked that they have the correct link. Deleting files is a more painful problem; the symlinks will just point into never never land. If a file in fromdir is a symbolic link, lndir will make the same link in todir rather than making a link back to the (symbolic link) entry in fromdir. The -ignorelinks flag changes this behavior. OPTIONS
-silent Normally lndir outputs the name of each subdirectory as it descends into it. The -silent option suppresses these status messages. -ignorelinks Causes the program to not treat symbolic links in fromdir specially. The link created in todir will point back to the corresponding (symbolic link) file in fromdir. If the link is to a directory, this is almost certainly the wrong thing. This option exists mostly to emulate the behavior the C version of lndir had in X11R6. Its use is not recommended. -withrevinfo Causes any source control manager subdirectories (those named BitKeeper, CVS, CVS.adm, .git, .hg, RCS, SCCS, or .svn) to be treated as any other directory, rather than ignored. DIAGNOSTICS
The program displays the name of each subdirectory it enters, followed by a colon. The -silent option suppresses these messages. A warning message is displayed if the symbolic link cannot be created. The usual problem is that a regular file of the same name already exists. If the link already exists but doesn't point to the correct file, the program prints the link name and the location where it does point. SEE ALSO
ln(1). X Version 11 lndir 1.0.3 LNDIR(1)

Featured Tech Videos

All times are GMT -4. The time now is 10:20 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy