Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Recursive copy to a RANDOM name Post 302248396 by xerexes on Friday 17th of October 2008 01:21:49 PM
Old 10-17-2008
Yes I there are subirectories on the source side.

I'm trying to clean up thousands of image files which I have collected over the years. Unfortunately I haven't been keeping track of what copies I have where. It is very likely that there are duplicates of files spread out.

My goal is to consolidate these files into one directory and remove duplicates using md5sum.

The folder structures they are in have been copied over from Windows systems which means that there is white space in some of the path names (and possibly other characters) which may make copying them less than straightforward. This is why I thought of doing a recursive copy to one directory and incorporating a random name to the file would help.

If you have an easy way to do this, I would greatly appreciate hearing it.

I've tried experimenting with bash scripts but none have worked (which probably says more about my scripting skills than anything else.)

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

recursive copy of hidden files

I need to know how to copy hidden files recursively? cp -r sourceDir/* targetDir/. ignores the hidden files. Thank you!! (2 Replies)
Discussion started by: usfrog
2 Replies

2. Programming

recursive copy of the directory

I want to copy a directory recursively ( it again has directories) and the directory is on windows and is nfsmounted in vxWorks, i am using unix to develop the code for this, can any one suggest me how to copy the directories recursively. (7 Replies)
Discussion started by: deepthi.s
7 Replies

3. UNIX for Dummies Questions & Answers

help with recursive copy command

Hi Guys, I am experiencing a problem right now while copying a directory as well as its subdirectories to my target directory. I know this is a very simple UNIX command using cp -R source directory target directory. but unfortunatley while doing this an error comes up on the command line saying... (2 Replies)
Discussion started by: Knowledge_Xfer
2 Replies

4. Shell Programming and Scripting

scp : recursive copy doesn't work

Hi I have a problem with scp command : I try to copy a list of files from source to destination, it works fine but if there is a directory not existing on destination, it doesn't automatic create. Syntax : scp -rp /<PATH>/<NEW_DIR>/<FILE> <USER_DEST>@<HOST_DEST>:<PATH>/<NEW_DIR>/<FILE>... (5 Replies)
Discussion started by: madmat
5 Replies

5. Ubuntu

expect script for random password and random commands

Hi I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue: I want expect script for random passwords and random commands generation. please can anyone help me? Many Thanks in advance (0 Replies)
Discussion started by: vanid
0 Replies

6. Shell Programming and Scripting

recursive search and copy

Hello again. Well, I need help again sooner as I thought. Now I want to search for files with a known name within all subdirs, and copy the to differently named files in the same directory. For example if I had only one file to copy, I would just usecp fileName newFileNamebut to do this... (1 Reply)
Discussion started by: cabaciucia
1 Replies

7. UNIX for Dummies Questions & Answers

recursive copy into a directory and all its subdirectories...

I want to copy a file from the top directory into all the sub-folders and all of the sub-folders of those sub-folder etc. Does anyone have any idea how to do this? Thanks in advance of any help you can give. (3 Replies)
Discussion started by: EinsteinMcfly
3 Replies

8. Shell Programming and Scripting

Recursive search for files and copy to new directories

So I have extremely limited experience with shell scripting and I was hoping someone could point out a few commands I need to use in order to pull this off with a shell script like BASH or whatnot (this is on OS X). I need to search out for filenames with account numbers in the name itself... (3 Replies)
Discussion started by: flyawaymike
3 Replies

9. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies

10. HP-UX

Recursive copy of Folders with files

Dear All, I will appreciate any help received. Our system is running on hpux v1 My problem is as follows: We have many customer folders with name fd000100, fd000101 and so on e.g. (Testrun)(testsqa):/>ll /TESTrun/fd000100 total 48 drwxrwx--- 2 fq000100 test 96 Jun 27 2004... (17 Replies)
Discussion started by: mhbd
17 Replies
lif(4)							     Kernel Interfaces Manual							    lif(4)

NAME
lif - logical interchange format description DESCRIPTION
LIF (Logical Interchange Format) is a Hewlett-Packard standard mass-storage format that can be used for interchange of files among various HP computer systems. A LIF volume contains a header (identifying it as a LIF volume) and a directory that defines the contents (i.e. files) of the volume. The size of the directory is fixed when the volume is initialized (see lifinit(1)) and sets an upper bound on the number of files that can be created on the volume. HP-UX contains a set of utilities (referred to as lif*(1)) that can be used to: o Initialize a LIF volume (i.e. create a header and an empty directory), o Copy files to and from LIF volumes, o List the contents of LIF volumes, o Remove LIF files, o Rename LIF files. The lif*(1) utilities are the only utilities within HP-UX where the internal structure of a LIF volume is known. To the rest of HP-UX, a LIF volume is simply a file containing some unspecified data. The term LIF volume should in no way be confused with the HP-UX notion of a file system volume or mountable volume. LIF utilities on HP-UX currently support three file types, ASCII (1), BINARY (-2) and BIN (-23951). Three copying modes are associated with these file types: If the copying mode is ASCII and an HP-UX file is being copied to a LIF volume, the utility strips the trailing LF (line-feed) character, and inserts two bytes of record length in front of each record. These records are then written to a LIF-formatted medium. When copying a LIF ASCII file to HP-UX the two-byte record length is stripped and a trailing LF is appended. These records are then written to the destination. In this mode of copying, the length of the file is preserved. The default file type for this mode of copying is ASCII (1). If the copying mode is and an HP-UX file is being copied to a LIF volume, the utility simply inserts two bytes for record length in front of each 1-Kbyte record. A trailing fractional block has a count reflecting the number of bytes in that block. No interpretation is placed on the content of the records. These records are then written to a LIF-format medium. When copying a LIF file to an HP-UX file in copying mode, the record lengths are stripped and the content of records is directly written to the destination. In this mode of copying, the length of the binary file is preserved. The default file type for this mode of copying is (-2). If the copying mode is RAW, and an HP-UX file is being copied to a LIF volume, the utility simply copies the raw data to the destination. File sizes that are not integer multiples of 256 bytes are padded with nulls to the next higher multiple. Therefore, When copying a LIF file to an HP-UX file in RAW mode, the information is copied directly without any interpretation placed on the content of the source. The default file type for this mode of copying is (-23951). A LIF volume can be created on any HP-UX file (either regular disk file or device special file) that supports random access via (see lseek(2)). lif*(1) utilities. See lifinit(1) for details. Within a LIF volume, individual files are identified by 1- to 10-character file names. File names can consist of uppercase alphanumeric characters (A through Z, 0 through 9) and the underscore character (_). The first character of a LIF file name must be a letter (A through Z). The lif*(1) utilities accept any file name (including illegal file names generated on other systems), but can only create legal names. This means that files whose names contain lowercase letters can be read but not created. LIF file names are specified to the lif*(1) utilities by concatenating the HP-UX path name for the LIF volume followed by the LIF file name, separating the two with a colon For example: specifies LIF file accessed via HP-UX device special file specifies LIF file within HP-UX disk file Note that this file-naming convention is applicable only for use as arguments to the lif*(1) utilities, and does not constitute valid path naming for any other use within the HP-UX operating system. lif*(1) utilities. SEE ALSO
lifcp(1), lifinit(1), lifls(1), lifrename(1), lifrm(1). lif(4)
All times are GMT -4. The time now is 09:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy