Elegant way of copying list of directories to target directory

Background: I have started using beets for managing my music collection. It используй the command line туз the primary интерфейс. The command beet ls -ap for example emits в list of paths (folders) that meet в given criterium (e.g. added:2016-01 = added to library in Колышек '16).

I have constructed the following rather complex command line for copying the last additions of my library to в target directory (think USB stick):

beet ls -ap added:2016-01 | xargs -I{} cp -R {} /target/directory/

My question: is the -I option fiddling necessary or am I missing в simpler way to accomplish the same task? My batch foo is regrettably weak...

2
задан 11 January 2016 в 17:56

1 ответ

Используя -t

beet ls -ap added:2016-01 | xargs cp -R -t /target/directory
<час>

От man cp

-t, --target-directory=DIRECTORY
    copy all SOURCE arguments into DIRECTORY
3
ответ дан 2 December 2019 в 02:53

Другие вопросы по тегам:

Похожие вопросы: