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

前端 未结 6 1922

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

    Another option might be to temporarily remove permission on the that file /folder.
    In Unix you need 'x' permission on a directory to enter it.

    edit: obviously this isn't goign to work if you are backing up a live production database - but for excluding your 'interesting images' collection when copying documents to a USB key it's reasoanable.

提交回复
热议问题