I have loads of folders and files in the storage system, files and folders created by a specific group needs to be removed, but I can't find any smart quick way to do it. Not via find or anything.

  • 1
    Be careful when you run commands like this, some groups are necessary for certain system resources. – Thomas Ward Sep 26 '18 at 13:43
  • The find dir -group groupname -print command does not work for you? – Lewis M Sep 26 '18 at 13:45

You can use find command for that

find /location -group group_name -delete

and yeah, please be careful with command as these. Before running just double & make sure that you know what you are doing.

  • Oh I have done my share of mistakes with these kinds of commands so no worries will be careful! Thanks! – swe_mattias Sep 26 '18 at 13:51
  • @rɑːdʒɑ you might want to add an echo or -i, so that other people unable to read won't just copy paste and harm their system... – RoVo Sep 26 '18 at 13:55
  • @rɑːdʒɑ Strictly speaking you don't delete folders and files "created by" the group_name as asked by the OP, but folders and files "owned by" group_name. A group creates nothing. – muclux Sep 26 '18 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.