开发者

"Substract" folder from another one (reverse copy)

开发者 https://www.devze.com 2023-04-03 04:04 出处:网络
I copied some files from a folder to another folder using the command cp -R ~/foo/* / Now I want to undo this. I know this is possible, 开发者_如何学Cbut what would be the easiest way to achieve this

I copied some files from a folder to another folder using the command cp -R ~/foo/* /

Now I want to undo this. I know this is possible, 开发者_如何学Cbut what would be the easiest way to achieve this?


Something like this might work:

for f in `ls src`
do
    rm "dst/$f"
done

Watch out for icky filenames with whitespace in them though.

0

精彩评论

暂无评论...
验证码 换一张
取 消