Is there a tar command to exclude sub-directories but include every file in the root of the folder and then place them at specific path?
I would like to omit every subdir, and only keep files max-min depth = 1 I have tried the follwing but its not working:
tar -cvf r.tar --exclude='~/root-dir/[subdir, ... ]' ~/Desktop
root-dir/
|
├── subdir/
│ ├── subdir/
│ │ └── a.txt
│ |
│ ├── subdir/
│ │ └── b.txt
│ │
│ └── c.txt
├── subdir/
│ ├── subdir/
│ │ └── d.txt
│ │
│ ├── subdir/
│ │ └── subdir/
│ │ └── subdir/
| | └── subdir/...
|
|
└── apple.txt
└── banana.image
└── ...