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

前端 未结 6 1924

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:31

    If you're using bash and enable extglob via shopt -s extglob then you can use !() to exclude the given pattern.

提交回复
热议问题