Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Find a list of files in directory, move to new, allow duplicates Post 302912097 by Clyde Lovett on Tuesday 5th of August 2014 08:30:08 PM
Old 08-05-2014
You guys are great - thank you!

I hear you both re: the pre-planning, but actually I'm like the janitor here - housekeeping some shared directories where product photo is put into Dropbox by multiple users / employees etc. Images are placed in folders based on Vendor and sale name and then shared via the cloud. So these images could be buckshot all over the place & duplicated x-number of times as they might be needed in one folder for one particular sale and then some duplication to cover another sale with a different vendor and so forth. We have thousands of product SKUs and on this occasion these 300 are now sold out and we will not restock them so the task is to remove any photos that have the SKU number in the file name ... hence my conundrum and visit to this forum - which I am glad to have discovered!

I spend my day as the staff photographer but because I have some aptitude for computers I get the IT hat thrown at me on a regular basis. Hopefully this sheds some light on things Smilie

So a couple of things
1. I don't mind waiting for it to run - I can even run something overnight if it's going to take a very long time.

2. As the script finds and moves files, it would be great if there is no over-write of files with duplicate filenames, but rather if a duplicate filename is found that it just append the duplicate filename with something like copy, copy1, copy2, etc.
and ...

3. I understand this is a script and some of the things that I need to replace here - like path/to/targetdir ... but a few questions
a. what identifies the file that is the list of my "SKUs" (the search criteria)?
b. is my file with the list of SKUs a text file, one SKU per line? (probably yes)
c. in what way to I save this code and run it - I gather this is a script - what do I do with it (now I'm really showing my "dummy" status on this, but I learn fast so hang in there with me!).

Thank you again - I appreciate expanding my knowledge in this area and thank you all for your time.

Clyde
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find duplicates from multuple files with 2 diff types of files

I need to compare 2 diff type of files and find out the duplicate after comparing each types of files: Type 1 file name is like: file1.abc (the extension abc could any 3 characters but I can narrow it down or hardcode for 10/15 combinations). The other file is file1.bcd01abc (the extension... (2 Replies)
Discussion started by: ricky007
2 Replies

2. UNIX for Dummies Questions & Answers

Move all files in a directory tree to a signal directory?

Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management. Thanks in advance- Brian- (2 Replies)
Discussion started by: briandanielz
2 Replies

3. UNIX for Dummies Questions & Answers

Find files and display only directory list containing those files

I have a directory (and many sub dirs beneath) on AIX system, containing thousands of file. I'm looking to get a list of all directory containing "*.pdf" file. I know basic syntax of find command, but it gives me list of all pdf files, which numbers in thousands. All I need to know is, which... (4 Replies)
Discussion started by: r7p
4 Replies

4. Shell Programming and Scripting

find list of files from a list and copy to a directory

I will be very grateful if someone can help me with bash shell script that does the following: I have a list of filenames: A01_155716 A05_155780 A07_155812 A09_155844 A11_155876 that are kept in different sub directories within my current directory. I want to find these files and copy... (3 Replies)
Discussion started by: manishabh
3 Replies

5. Shell Programming and Scripting

Move files in a list to another directory

I have a number of files in a directory that can be grouped with something like "ls | grep SH2". I would like to move each file in this list to another directory. Thanks (4 Replies)
Discussion started by: kg6iia
4 Replies

6. Shell Programming and Scripting

Please help list/find files greater 1G move to different directory

I have have 6 empty directory below. I would like write bash scipt if any files less "1000000000" bytes then move to "/export/home/mytmp/final" folder first and any files greater than "1000000000" bytes then move to final1, final2, final3, final4, final4, final5 and that depend see how many files,... (6 Replies)
Discussion started by: dotran
6 Replies

7. Shell Programming and Scripting

Copying files from one directory to another, renaming duplicates.

Below is the script i have but i would like simplified but still do the same job. I need a script to copy files not directories or sub-directories into a existing or new directory. The files, if have the same name but different extension; for example 01.doc 01.pdf then only copy the .doc file. ... (1 Reply)
Discussion started by: Gilljambo
1 Replies

8. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

9. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies
DH_AUTORECONF(1)						   dh-autoreconf						  DH_AUTORECONF(1)

NAME
dh_autoreconf - Call autoreconf -f -i and keep track of the changed files. SYNOPSIS
dh_autoreconf [debhelper options] [-Xitem] [--mode=mode] [program -- params] DESCRIPTION
dh_autoreconf is responsible for calling autoreconf and creating the files debian/autoreconf.before and debian/autoreconf.after which contain checksums of all files before/after the build. It is complemented by dh_autoreconf_clean which creates a list of all changed and added files and removes them. Please note that dh_autoreconf can only be run once. Thus, if you need to run multiple commands, use a script or similar. An example is given in dh-autoreconf(7). FILES
debian/autoreconf This file can contain a list of directories. If present, dh_autoreconf will only scan the given directories for changes. If no special command is given to dh_autoreconf, it will also forward the directory list to autoreconf which causes it to be run only on those sub directories. OPTIONS
-Xitem --exclude=item Exclude files that contain "item" anywhere in their filename from being checked for changes. This means that those files won't be deleted by "dh_autoreconf_clean" even if there are changes. You may use this option multiple times to build up a list of things to exclude. Starting with version 3, the directories of common version control systems such as cvs, git, hg, svn, and bzr are excluded automatically. --mode=mode Change the way in which modifications to files are detected. The default mode is md5 for using MD5 checksums, but there is also timesize for using the time of the last modification and the file size. --as-needed Enable support for -Wl,--as-needed in all ltmain.sh files identical to the one of the libtool package. This only works in the MD5 mode (the default one). The changes are reverted in dh_autoreconf_clean. You should not prevent LIBTOOLIZE from running with this, as it only works correctly with libtoolize running. program -- params Run the program given by program with the arguments given by params instead of autoreconf -f -i. If you need to run multiple commands, put them in a script and pass the script instead (or add a target to debian/rules). ENVIRONMENT
For each tool executed by autoreconf(1), one can export a variable with the uppercase name of the tool to the specific program which shall be run, including true to prevent the tool in question from being run. The following example shows the beginning of a debian/rules for a package where automake 1.10 shall be run instead of the default automake version and libtoolize shall not be run: #!/usr/bin/make -f export AUTOMAKE = automake1.10 export LIBTOOLIZE = true SEE ALSO
debhelper(7), dh_autoreconf_clean(1), dh-autoreconf(7) AUTHOR
Julian Andres Klode <jak@debian.org> dh-autoreconf v7 2012-11-22 DH_AUTORECONF(1)
All times are GMT -4. The time now is 02:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy