5
votes
4answers
573 views

Copying specific subfolders with directory structure to a new folder

I am having a the following directory structure: Main_Dir | ----------------------------------- Subdir1 Subdir2 Subdir3 | | ...
11
votes
3answers
2k views

Flattening a nested directory

This is probably very simple, but I can't figure it out. I have a directory structure like this (dir2 is inside dir1): /dir1 /dir2 | --- file1 | --- file2 What is ...
4
votes
2answers
3k views

Difference between cp -r and cp -a

Looking for the difference between cp -r and cp -a? What does recursive mean in terms of copying files from a folder?
7
votes
1answer
183 views

Strange behaviour in recursive copy

Could someone explain why this happens? Most specifically: Why is one 1's content copied to f? And why is f copied to g? $ tree . 0 directories, 0 files $ mkdir 1 $ mkdir 2 $ touch 1/a $ touch ...
5
votes
3answers
1k views

recursively copy only images and preserve path

I'm working on a website migration. I have a scrape of the site, with all the files and directory structure as you would see them in the URL. I want to pull all images, maintaining the directory ...