简体   繁体   中英

Changing owner of all folder except one folder

I want to change ownership of all of my folders, so I use this command:

chown -R root: *

Now I want to say change all folders except ./test folder.

Is it possible ?

Set the extglob option and then exclude the desired folder:

shopt -s extglob
chown -R root: !(test)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM