Skip to main content
deleted 5 characters in body
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265

Suppose I have this structure for folder0 and subfolders and files in it.

   folder0
      subfolder01
        file011
        file012
      subfolder02
        file021
      file01
      file02

I want to copy all files in main folder folder0 to somewhere else, such that all file be in one directory? How Can I do that? I used

cp --recursive folder0address targetfolderaddress

But subfolders copied to target folder. I just want all files in directory and sub directories not folders. I mean STHsomething like the below in target folder:

targetfolder
  file011
  file012
  file021
  file01
  file02

Thanks.

Suppose I have this structure for folder0 and subfolders and files in it.

   folder0
      subfolder01
        file011
        file012
      subfolder02
        file021
      file01
      file02

I want to copy all files in main folder folder0 to somewhere else, such that all file be in one directory? How Can I do that? I used

cp --recursive folder0address targetfolderaddress

But subfolders copied to target folder. I just want all files in directory and sub directories not folders. I mean STH like below in target folder:

targetfolder
  file011
  file012
  file021
  file01
  file02

Thanks.

Suppose I have this structure for folder0 and subfolders and files in it.

   folder0
      subfolder01
        file011
        file012
      subfolder02
        file021
      file01
      file02

I want to copy all files in main folder folder0 to somewhere else, such that all file be in one directory? How Can I do that? I used

cp --recursive folder0address targetfolderaddress

But subfolders copied to target folder. I just want all files in directory and sub directories not folders. I mean something like the below in target folder:

targetfolder
  file011
  file012
  file021
  file01
  file02
Source Link
SirSaleh
  • 203
  • 1
  • 2
  • 6

How to copy "just files" recursively

Suppose I have this structure for folder0 and subfolders and files in it.

   folder0
      subfolder01
        file011
        file012
      subfolder02
        file021
      file01
      file02

I want to copy all files in main folder folder0 to somewhere else, such that all file be in one directory? How Can I do that? I used

cp --recursive folder0address targetfolderaddress

But subfolders copied to target folder. I just want all files in directory and sub directories not folders. I mean STH like below in target folder:

targetfolder
  file011
  file012
  file021
  file01
  file02

Thanks.