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

前端 未结 6 1905

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

    for file in *; do
      if [ $file != "file_I_dont_want_to_chown" ]
        then
          chown -R Camsoft $file
      fi
    done 
    

提交回复
热议问题