Problems with Copying Directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problems with Copying Directory
# 1  
Old 01-11-2006
Problems with Copying Directory

Hi, i'm completely new to Unix.

I'm trying to copy my "Pictures" folder, and all the folders under it, to a different folder "Photos".

So say "Pictures" has a sub folder "2".

what happens is "2" is copied to "Photos" like i want it to, but then a sub directory "tmp2" is made which contains a copy of all the photos in "2", and then there's a sub directory to "tmp2" called "tmp2" which has a copy of all the photos in "2" and it keeps going until my harddrive fills.

I just want to copy all the folders under "Pictures" to "Photos"
how do i do this?

what i'm currently doing is this:

cp -r /Volumes/Mike/Pictures /Photos
# 2  
Old 01-11-2006
Maybe you have a loop caused by a symbolic link? Try this command to see:
find /Volumes/Mike/Pictures -type l -print | xargs ls -l
# 3  
Old 01-11-2006
I tried that, it took about 30 seconds, and then nothing happened. took me back to the original prompt
# 4  
Old 01-12-2006
hmm, is the volume mount point a windows partition by any chance ? is this pictures folder on the windows partition ? if yes, then probably the folder has a link to tmp2 which has a link to tmp2. In windows the link is a shortcut. so probably the find may not be detecting it. just a wild guess.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Continuous Copying from a directory to another.

Hello Folks, Looking for a script, where i can check for the existing of the files in a directory and copying to another. How can i achieve it in loop for over period of time. whatever files comes into the folder copied in another without duplicate and should be continuous loop. ... (8 Replies)
Discussion started by: sadique.manzar
8 Replies

2. Shell Programming and Scripting

Copying files to a directory

Hi, I am newbie to unix scripting, need a help in the doubt i have. It is " when files are copied to a directory using cp command, they are arranged by default according to the file name, is there anyway where the files that are copied be arranged with respect to their size, with using the sort... (5 Replies)
Discussion started by: pundalik
5 Replies

3. Shell Programming and Scripting

Copying subdirectories of a directory to some other directory and renaming them

Hi, I am a newbie in shell scripting. I have to copy a particular sub-directory (data) from a large no. of directories (all in the same folder) and paste them to another directory ( /home/hubble/data ) and then rename all the subdirectories (data) as the name of its parent directory. please... (8 Replies)
Discussion started by: sholay
8 Replies

4. Shell Programming and Scripting

Copying files from one directory into another.

Could someone please tell me if there is a command similar to head or tail that can be used on directories. I want to select a given number of files from a directory and copy them into another directory. But I found out I can't use head as it doesn't (or I don't know how yet!) work on directories.... (4 Replies)
Discussion started by: Krush187
4 Replies

5. UNIX for Dummies Questions & Answers

Having problems copying a file from a script

Hello. Complete newbie over here, and I'm hoping you can help me out with this problem. The script copies a file to a directory within my home dir. Permissions are ok and the source file exists. If I execute the cp command from the command line or hardcode the path/file name, it works. ... (6 Replies)
Discussion started by: verdugan
6 Replies

6. UNIX for Dummies Questions & Answers

Copying one file at a time from one directory to another directory.

Hi All i want to write a script which could copy one file at a time from one directory to another directory. Scenerio: Let's say i have 100 file in a dirctory,so i want to copy one file at a time to another directory with a sleep statement in between that of 30 secs. please help me... (1 Reply)
Discussion started by: Nikhilindurkar
1 Replies

7. UNIX for Dummies Questions & Answers

Copying files from one directory to Other

Hi UNIX Gurus, Could please help me out regarding following situation. I am copying some files from one directory to other directotry using following command. cp /var/tmp/*date*.gz /var/tmp/user/ Problem: Once the copy has completed, I need to check whether all the files (including... (3 Replies)
Discussion started by: satishkeshetty
3 Replies

8. UNIX for Dummies Questions & Answers

Copying with directory structure

Hi, I need to copy a set of directories along with all sub directories and files from one unix box to another. Any ideas? cnfsed (4 Replies)
Discussion started by: Cnfsed
4 Replies

9. UNIX for Dummies Questions & Answers

copying a file from one directory to another

Hi This is my first day in Unix, and I am trying to copy a file called holiday.txt from my D drive into the C drive folder called h like currently i am in D drive, i want to copy my holiday.txt into C\h (C drive, h folder) i am able to copy the file in the same drive, but how to do the... (5 Replies)
Discussion started by: soujanya_srk
5 Replies

10. UNIX for Dummies Questions & Answers

Copying from CDROM to Directory

Can someone please tell me how to copy a file from a CD that I mounted to a directory in a SCO Unixware system? Thanks in advance (1 Reply)
Discussion started by: George26
1 Replies
Login or Register to Ask a Question