How do I exclude a folder when performing file operations i.e. cp, mv, rm and chown etc. in Linux

前端 未结 6 1927

How do you exclude a folder when performing file operations i.e. cp etc.

I would currently use the wild card * to apply file operation to all, but I need to exclude one

6条回答
  •  长情又很酷
    2021-02-03 11:24

    Combine multiple small sharp tools of unix: To exclude the folder "foo"

    % ls -d * | grep -v foo | xargs -d "\n" chown -R Camsoft
    

提交回复
热议问题