How to copy a file to multiple directories using the gnu cp command

前端 未结 22 2008
终归单人心
终归单人心 2020-12-02 03:25

Is it possible to copy a single file to multiple directories using the cp command ?

I tried the following , which did not work:

cp file1 /foo/ /bar         


        
22条回答
  •  一生所求
    2020-12-02 04:08

    Using a bash script

    DESTINATIONPATH[0]="xxx/yyy"
    DESTINATIONPATH[1]="aaa/bbb"
                    ..
    DESTINATIONPATH[5]="MainLine/USER"
    NumberOfDestinations=6
    
    for (( i=0; i

提交回复
热议问题