New answers tagged cp
0
votes
Any command to exclude all types of files only?
You can use the following rsync options to only copy directory tree :
rsync -av -f"+ */" -f"- *" /path/to/src /path/to/dest/
Command explained in details there :
https://www....
0
votes
How to exclude different levels of subdirectories with cp?
If you only want to copy the directories and no files or sub-directories, it' easy:
terdon@oregano test folders $ tree
.
├── 1
│ ├── 1-1
│ ├── 1-2
│ ├── 1-3
│ ├── file-1
│ └── file-2
├── 2
│ ...
1
vote
find & cp command doesn't copy 1st level directory
-maxdepth 1 is a directive for find. Because of it your find will run cp … for ./1 and it won't run cp … for ./1/1-1; and so on. Note it will run cp … for . in the first place.
When your find runs cp -...
Top 50 recent answers are included
Related Tags
cp × 773linux × 99
bash × 97
files × 85
file-copy × 75
find × 71
shell × 70
rsync × 70
command-line × 64
directory × 58
shell-script × 55
mv × 42
permissions × 32
symlink × 29
rename × 28
recursive × 24
filenames × 23
wildcards × 23
xargs × 21
macos × 20
backup × 18
hard-link × 17
coreutils × 17
filesystems × 16
ubuntu × 15