Copy files/directories excluding multiple paterns


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Copy files/directories excluding multiple paterns
# 1  
Old 04-25-2012
Copy files/directories excluding multiple paterns

my directory structure is like below:

Code:
basedir\
           p.txt
           q.htm
           r.java
        b\
           abc.htm
           xyz.java
        c\
           p.htm
           q.java
           rst.txt

my requirement is i want to copy all the files and directories from "basedir" but excluding few patterns, pattern can be a file,directory or regex

for example:
copy all files from "basedir" excluding directory "b" and excluding "*.html" from directory "c" and excluding "*.java" from "basedir"

i tried "find" using prone but got stuck while specifying multiple patterns.

can anyone pleas help?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to copy particular files from a multiple directories and paste in a new directory?

Dear all I have a multiple directories, say for example org1, org2, org3 ..... org100 and each directory having a file namely dnaG.fasta. I need to copy all the dnaG.fasta file from each directory and paste in another directory fastconcatg. Therefore, my script has to copy dnaG.fasta file from... (5 Replies)
Discussion started by: dineshkumarsrk
5 Replies

2. Shell Programming and Scripting

Find command excluding directories and some files

hello. I try to print a list of files but excluding some directories and some files. I would like to write a command for : find "from_dir" "ignore dir1, dir2, ..." "ignore file1, file2,...." "where file are older than 2017-02-03T06:00:00" Note that "DO_IT" is a local function in the script... (5 Replies)
Discussion started by: jcdole
5 Replies

3. UNIX for Advanced & Expert Users

Find all files in the current directory excluding hidden files and directories

Find all files in the current directory only excluding hidden directories and files. For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided. `find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Discussion started by: ksailesh1
7 Replies

4. UNIX for Dummies Questions & Answers

copy file using unix in multiple directories

Hi All Genious, I want to copy a file name XYZ .In a directory /HOME/dir/IXOS1/dir1 which contain multiple directories named not in pattern want to copy the XYZ in all of the directories available on path /HOME/dir/IXOS1/dir1 . Thanks in advance . (2 Replies)
Discussion started by: mumakhij
2 Replies

5. Shell Programming and Scripting

Copy files from multiple directories into one directory without overwriting them

I have several directories and all those directories have .dat files in them. I want to copy all those .dat files to one directory say "collected_directory" The problem is I don't want to overwrite files. So, if two file names match, I don't want the old file to be overwritten with a new one. ... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. Shell Programming and Scripting

Copy one folder to multiple directories

Hello, I have a small question and i hope someone can help me, if i have 200 domains directories in my server under this directory something like now how i can copy one folder i have to this directories? Thank You (5 Replies)
Discussion started by: GamGom
5 Replies

7. UNIX for Dummies Questions & Answers

List directories and sub directories recursively excluding files

Hi, Please help me, how to get all the direcotries, its sub directories and its sub directories recursively, need to exclude all the files in the process. I wanted to disply using a unix command all the directories recursively excluding files. I tried 'ls -FR' but that display files as... (3 Replies)
Discussion started by: pointers
3 Replies

8. UNIX for Dummies Questions & Answers

Copy Directories excluding files

Hi guys, I want to copy folder and sub folders only. I don't want the files. If i use cp -r command it will copy entirely with files. Could any one suggest me. Thanks in advance (1 Reply)
Discussion started by: karthik82
1 Replies

9. UNIX for Dummies Questions & Answers

Copy single file to multiple directories

Please help - I need to copy a single file to multiple directories. Dir structure: Parent_Directoy Filename1 Child_Directory1 Child_Directory2 Child_Directory3 Child_Directory4 .... So I need to copy Filename1 to all of the... (2 Replies)
Discussion started by: kthatch
2 Replies

10. UNIX for Dummies Questions & Answers

copy multiple files in different directories

I have a report file that is generated every day by a scheduled process. Each day the file is written to a directory named .../blah_blah/Y07/MM-DD-YY/reportmmddyy.tab I want to copy all of this reports to a separate directory without having to do it one by one. However, if I try cp... (3 Replies)
Discussion started by: ken2834
3 Replies
Login or Register to Ask a Question
JSYMPHONIC(1)						      General Commands Manual						     JSYMPHONIC(1)

NAME
jsymphonic - File manager for Sony's MP3 players SYNOPSIS
jsymphonic DESCRIPTION
jsymphonic manages files stored on a Sony MP3 player plugged onto the computer. Important note: The MP3 player should be mounted first ! You might want to use pmount(1) to mount it without needing root privileges. The first time it is run, jsymphonic will ask you in which directory the MP3 player is mounted. This directory should not change, or you will need to configure it again. If jsymphonic complains that it cannot find the OMGAUDIO folder, it means that either the music player is not mounted, either the path of the player has not been set yet. If that is the case, set it using the JSymphonic/Properties menu item. JAVA-WRAPPERS NOTE This program is a shell script wrapper based on java-wrappers(7). You therefore benefit from several features; please see the java-wrap- pers(7) manual page for more information about them. SEE ALSO
pmount(1) and java-wrappers(7) AUTHOR
This manual page was written by Vincent Fourmond <fourmond@debian.org> from the Debian project, but may be used by others. 26-01-2009 JSYMPHONIC(1)