New answers tagged

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....
Bertrand Cebador's user avatar
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 │ ...
terdon's user avatar
  • 239k
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 -...
Kamil Maciorowski's user avatar

Top 50 recent answers are included