{"id":8789,"date":"2020-07-19T07:59:51","date_gmt":"2020-07-19T11:59:51","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=8789"},"modified":"2021-12-04T07:36:15","modified_gmt":"2021-12-04T07:36:15","slug":"delete-group-linux-groupdel-delgroup","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/","title":{"rendered":"How to Delete Group in Linux Using groupdel and delgroup"},"content":{"rendered":"\n

On Linux operating systems user groups are defined in the \/etc\/group<\/em> file. This is a simple text file that should not be edited directly. What if you want to delete group details? Well, Linux<\/a> provides command-line tools that will allow you to do it.<\/p>\n\n\n\n

Prerequisites<\/h2>\n\n\n\n

This guide makes assumptions that you have a complete Ubuntu server set up<\/a> with users already added to the system<\/a>.<\/p>\n\n\n\n

In this guide, we will show you how to use the groupdel<\/em> command and delgroup<\/em> commands to delete all the group information.<\/p>\n\n\n\n

How to delete a group in Linux where groupname<\/em> is the name of the group:<\/p>\n\n\n\n

  1. Run the following command to delete a group using the groupdel<\/em> command:<\/li><\/ol>\n\n\n\n
    $ sudo groupdel groupname<\/code><\/pre>\n\n\n\n
    1. Run the following command to delete a group using the delgroup<\/em> command:<\/li><\/ol>\n\n\n\n
      $ sudo delgroup groupname<\/code><\/pre>\n\n\n\n

      or<\/p>\n\n\n\n

      $ sudo delgroup --group groupname<\/code><\/pre>\n\n\n\n

      You can list the existing groups using the following command:<\/p>\n\n\n\n

      $ cat \/etc\/group<\/code><\/pre>\n\n\n\n

      How about if you want to find out which groups a particular user belongs to. You can retrieve that information using the following command:<\/p>\n\n\n\n

      $ groups username<\/code><\/pre>\n\n\n\n

      You can restrict deleting groups to if the group is a system group. This protects from accidentally deleting non-system groups.<\/p>\n\n\n\n

      $ sudo delgroup --system --group groupname<\/code><\/pre>\n\n\n\n

      You can also backup group files before deleting the group using this command:<\/p>\n\n\n\n

      $ sudo delgroup --backup --group groupname<\/code><\/pre>\n\n\n\n

      If you just want to remove a user from a group you can use the following command:<\/p>\n\n\n\n

      $ sudo deluser username groupname<\/code><\/pre>\n\n\n\n

      Conclusion on Delete Group in Linux<\/h2>\n\n\n\n

      The above commands work on all major Linux distros such as Arch Linux, CentOS<\/a>, Debian<\/a>, Fedora, RHEL, and Ubuntu<\/a> among others. Meanwhile, you can follow this guide on how to delete users from Linux found here<\/a> or this one about how to add a user in Linux systems<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

      On Linux operating systems user groups are defined in the \/etc\/group file. This is a simple text file that should not be edited directly. What if you want to delete…<\/p>\n","protected":false},"author":1,"featured_media":8790,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,16,18],"tags":[121,183,193,354,424,431,526,573,591,598],"yoast_head":"\nHow to Delete Group in Linux Using groupdel and delgroup Commands<\/title>\n<meta name=\"description\" content=\"Linux operating systems provide groupdel and delgroup command-line tools that will allow you to to update and delete group in the operating system\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Delete Group in Linux Using groupdel and delgroup Commands\" \/>\n<meta property=\"og:description\" content=\"Linux operating systems provide groupdel and delgroup command-line tools that will allow you to to update and delete group in the operating system\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-19T11:59:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-04T07:36:15+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Delete Group in Linux Using groupdel and delgroup\",\"datePublished\":\"2020-07-19T11:59:51+00:00\",\"dateModified\":\"2021-12-04T07:36:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/\"},\"wordCount\":276,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg\",\"keywords\":[\"CentOS\",\"Debian\",\"DevOps\",\"Linux\",\"Open Source\",\"Operating Systems\",\"Security\",\"Systems Administration\",\"Tools\",\"Ubuntu\"],\"articleSection\":[\"Articles\",\"Guides\",\"Technology\",\"Tools\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/\",\"url\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/\",\"name\":\"How to Delete Group in Linux Using groupdel and delgroup Commands\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg\",\"datePublished\":\"2020-07-19T11:59:51+00:00\",\"dateModified\":\"2021-12-04T07:36:15+00:00\",\"description\":\"Linux operating systems provide groupdel and delgroup command-line tools that will allow you to to update and delete group in the operating system\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg\",\"width\":1200,\"height\":630,\"caption\":\"Delete Group in Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Delete Group in Linux Using groupdel and delgroup\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/twitter.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Delete Group in Linux Using groupdel and delgroup Commands","description":"Linux operating systems provide groupdel and delgroup command-line tools that will allow you to to update and delete group in the operating system","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/","og_locale":"en_US","og_type":"article","og_title":"How to Delete Group in Linux Using groupdel and delgroup Commands","og_description":"Linux operating systems provide groupdel and delgroup command-line tools that will allow you to to update and delete group in the operating system","og_url":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2020-07-19T11:59:51+00:00","article_modified_time":"2021-12-04T07:36:15+00:00","og_image":[{"width":1200,"height":630,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Delete Group in Linux Using groupdel and delgroup","datePublished":"2020-07-19T11:59:51+00:00","dateModified":"2021-12-04T07:36:15+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/"},"wordCount":276,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg","keywords":["CentOS","Debian","DevOps","Linux","Open Source","Operating Systems","Security","Systems Administration","Tools","Ubuntu"],"articleSection":["Articles","Guides","Technology","Tools"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/","url":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/","name":"How to Delete Group in Linux Using groupdel and delgroup Commands","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg","datePublished":"2020-07-19T11:59:51+00:00","dateModified":"2021-12-04T07:36:15+00:00","description":"Linux operating systems provide groupdel and delgroup command-line tools that will allow you to to update and delete group in the operating system","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-group-linux-groupdel-delgroup.jpg","width":1200,"height":630,"caption":"Delete Group in Linux"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/delete-group-linux-groupdel-delgroup\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Delete Group in Linux Using groupdel and delgroup"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/twitter.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/8789"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=8789"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/8789\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/8790"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=8789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=8789"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=8789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}