{"id":8233,"date":"2023-03-22T05:26:08","date_gmt":"2023-03-22T05:26:08","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=8233"},"modified":"2023-12-26T05:52:26","modified_gmt":"2023-12-26T05:52:26","slug":"delete-multiple-users-in-linux","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/","title":{"rendered":"How to Delete Multiple Users in Linux? [2 Steps]"},"content":{"rendered":"<p style=\"text-align: justify;\"><a href=\"https:\/\/www.linux.org\/\" target=\"_blank\" rel=\"noopener\"><strong>Linux<\/strong><\/a> is a multiuser operating system. Therefore, you may want to delete multiple users along with creating them. Unfortunately, <strong>Linux <\/strong>does not offer any built-in command to delete multiple users at once. There is only <a href=\"https:\/\/linuxsimply.com\/userdel-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>userdel<\/strong> <strong>command<\/strong><\/a> available that can remove one user account at a time. However, you need to be a <a href=\"https:\/\/linuxsimply.com\/what-is-root-user-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>root<\/strong> <strong>user<\/strong><\/a> or have <a href=\"https:\/\/linuxsimply.com\/what-is-root-access-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>root\/sudo privileges<\/strong><\/a> to remove users. You can also utilize the bash scripting technique to automate the deletion system and remove multiple users simultaneously from your machine. In this article, you will learn all about how to delete multiple users in <strong>Linux<\/strong>.<\/p>\n<div class=\"su-button-center\"><a href=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/delete_users.zip\" class=\"su-button su-button-style-default\" style=\"color:#000000;background-color:#E8F9FF;border-color:#bac8cc;border-radius:56px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#000000;padding:8px 26px;font-size:20px;line-height:30px;border-color:#effbff;border-radius:56px;text-shadow:0px 0px 0px #000000\"><i class=\"sui sui-download\" style=\"font-size:20px;color:#1AA1D6\"><\/i>  Download bash file to delete multiple users in Linux<\/span><\/a><\/div>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#Process_Flow_Chart_to_Delete_Multiple_Users_in_Linux\" >Process Flow Chart to Delete Multiple Users in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#Watch_Video_to_Delete_Multiple_Users_in_Linux\" >Watch Video to Delete Multiple Users in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#2_Steps_to_Delete_Multiple_Users_in_Linux\" >2 Steps to Delete Multiple Users in Linux<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#1_Preparing_a_Script_to_Delete_Multiple_Users_in_Linux\" >1. Preparing a Script to Delete Multiple Users in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#2_Executing_Script_to_Delete_Multiple_Users_in_Linux\" >2. Executing Script to Delete Multiple Users in Linux<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#Complementary_Information\" >Complementary Information<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#Delete_User_Without_home_directory_in_Linux\" >Delete User Without home directory in Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#Delete_Multiple_Users_From_a_Group_in_Linux\" >Delete Multiple Users From a Group in Linux<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#People_Also_Ask\" >People Also Ask<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#What_is_the_command_to_delete_user_in_Ubuntu\" >What is the command to delete user in Ubuntu?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#How_to_Remove_User_and_user_group_in_Ubuntu\" >How to Remove User and user group in Ubuntu?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#How_do_I_list_all_users_in_Ubuntu\" >How do I list all users in Ubuntu?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#How_do_I_bulk_delete_in_Linux\" >How do I bulk delete in Linux?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#How_do_I_add_and_remove_users_in_Linux\" >How do I add and remove users in Linux?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#How_do_I_remove_a_user_from_login_screen_Linux\" >How do I remove a user from login screen Linux?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#How_do_I_remove_a_user_from_login_shell\" >How do I remove a user from login shell?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#How_can_I_see_all_Users_logged_in\" >How can I see all Users logged in?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Process_Flow_Chart_to_Delete_Multiple_Users_in_Linux\"><\/span>Process Flow Chart to Delete Multiple Users in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong>[Distro Used Throughout the Tutorial:<\/strong> <a href=\"https:\/\/ubuntu.com\/download\/desktop\" target=\"_blank\" rel=\"noopener\"><strong>Ubuntu 22.04.1 LTS<\/strong><\/a>]<img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-8267\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/1-how-to-delete-multiple-users-flowchart.png\" alt=\"Flowchart for deleting multiple users in linux.\" width=\"516\" height=\"383\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/1-how-to-delete-multiple-users-flowchart.png 516w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/1-how-to-delete-multiple-users-flowchart-300x223.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/1-how-to-delete-multiple-users-flowchart-768x570.png 768w\" sizes=\"(max-width: 516px) 100vw, 516px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Watch_Video_to_Delete_Multiple_Users_in_Linux\"><\/span>Watch Video to Delete Multiple Users in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"su-youtube su-u-responsive-media-yes\"><iframe width=\"600\" height=\"400\" src=\"https:\/\/www.youtube.com\/embed\/gBB9PgdmAY8?\" frameborder=\"0\" allowfullscreen allow=\"autoplay; encrypted-media; picture-in-picture\" title=\"\"><\/iframe><\/div>\n<h3><span class=\"ez-toc-section\" id=\"2_Steps_to_Delete_Multiple_Users_in_Linux\"><\/span>2 Steps to Delete Multiple Users in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Since <strong>Linux <\/strong>does not offer any command to delete multiple users, you can use a bash script to delete multiple users. In this section, I will create a bash script using the <strong>userdel command <\/strong>within a <strong>for loop <\/strong>to delete multiple users. To make the script interactive, I will also apply the <strong>if condition<\/strong> on the <strong>userdel command<\/strong>.<\/p>\n<p style=\"text-align: justify;\">Furthermore, some extra commands such as <strong>read <\/strong>and <a href=\"https:\/\/linuxsimply.com\/echo-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>echo<\/strong><\/a> are utilized for taking user input and displaying output messages in the <a href=\"https:\/\/linuxsimply.com\/what-is-terminal-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>terminal<\/strong><\/a>. You can follow the process below to do the same.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"1_Preparing_a_Script_to_Delete_Multiple_Users_in_Linux\"><\/span>1. Preparing a Script to Delete Multiple Users in Linux<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>To prepare a script that deletes multiple users in a loop, follow the instructions below:<\/p>\n<ol>\n<li>At first, open a terminal window by pressing <strong>CTRL<\/strong>+<strong>ALT<\/strong>+<strong>T<\/strong>.<\/li>\n<li>Then, create a <strong>bin<\/strong> folder in your home directory by typing the following command.\n<pre><code class=\"language-bash\" data-line=\"\">mkdir bin<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><a href=\"https:\/\/linuxsimply.com\/mkdir-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>mkdir<\/strong><\/a><strong>: <\/strong>Creates a Directory.<\/li>\n<li><strong>bin: <\/strong>User\u2019s private <strong>bin directory<\/strong>.<\/li>\n<\/ul>\n<\/div><\/div>\n<p>However, you can skip this step if the directory is already created.<\/li>\n<li>After that, create a bash script file inside the <strong>bin directory<\/strong> with the command below.\n<pre><code class=\"language-bash\" data-line=\"\">nano bin\/delete_users.sh<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><a href=\"https:\/\/linuxsimply.com\/nano-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>nano<\/strong><\/a><strong>: <\/strong>Creates\/edits text files with Nano text editor.<\/li>\n<li><strong>delete_users.sh: <\/strong>File for writing bash script of deleting multiple users.<\/li>\n<\/ul>\n<\/div><\/div><\/li>\n<li>Now, write the following script in the <strong>delete_users.sh<\/strong> file for deleting multiple users in loop.\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\nread -p &quot;Enter number of Users to be deleted:&quot; num\necho &quot;------------------------------------------------------&quot;\nfor (( i=1; i&lt;=$num; i=i+1)); do\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 read -p &quot;Enter Username no.$i: &quot; uname\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if sudo userdel -r $uname ; then\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 echo &quot;------------------------------------------------------&quot;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 echo &quot;Successfully deleted User: $uname.&quot;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 echo &quot;------------------------------------------------------&quot;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 fi\ndone<\/code><\/pre>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-8268\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/2-bash-script.png\" alt=\"Bash script for deleting multiple users in linux.\" width=\"825\" height=\"577\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/2-bash-script.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/2-bash-script-300x210.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/2-bash-script-768x537.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>read -p \u201cMessage\u201d variable: <\/strong>Displays a message while taking input from the terminal and stores in the <strong>variable<\/strong>.<\/li>\n<li><strong>echo: <\/strong>Displays a given text.<\/li>\n<li><strong>$Variable: <\/strong>Returns the value stored in a <strong>Variable<\/strong>.<\/li>\n<li><strong>for (( InitialValue; TestExpression; UpdateStatement)); do done: <\/strong>Runs the commands inside the <strong>do <\/strong>and <strong>done <\/strong>keywords in a loop from the <strong>InitialValue<\/strong>. Updates the initial value using <strong>UpdateStatement<\/strong> or comes out of the loop depending on the <strong>TestExpression<\/strong>.<\/li>\n<li><a href=\"https:\/\/linuxsimply.com\/sudo-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>sudo<\/strong><\/a><strong>:<\/strong> Grants administrative privileges.<\/li>\n<li><strong>userdel:<\/strong> Deletes the specified user.<\/li>\n<li><strong>if [ condition ]; then else fi:<\/strong> Checks a condition. If the condition is true, execute the command\/commands after \u201cthen\u201d. Otherwise, execute the command after \u201celse\u201d.<\/li>\n<\/ul>\n<\/div><\/div><\/li>\n<li>To save and exit from the script, press <strong>CTRL<\/strong>+<strong>S <\/strong>and <strong>CTRL+X <\/strong>respectively.<\/li>\n<li>Now, Type the following to make the script executable for the current user in your system.\n<pre><code class=\"language-bash\" data-line=\"\">chmod u+rwx bin\/delete_users.sh<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><a href=\"https:\/\/linuxsimply.com\/chmod-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>chmod<\/strong><\/a><strong>: <\/strong>Changes folder permissions.<\/li>\n<li><strong>u+rwx: <\/strong>Adds <strong>read<\/strong>, <strong>write<\/strong> and <strong>execute <\/strong>permissions for the current user.<\/li>\n<li><strong>delete_users.sh: <\/strong>Bash script file for deleting multiple users.<\/li>\n<\/ul>\n<\/div><\/div><\/li>\n<li>Finally, <strong><a href=\"https:\/\/linuxsimply.com\/reboot-command-in-linux\/#Example_1_Restart_Your_System_Using_the_reboot_Command_in_Linux\" target=\"_blank\" rel=\"noopener\">restart your system<\/a><\/strong> to add the newly created <strong>bin directory<\/strong> to the <strong>$PATH <\/strong>variable by typing the command below.\n<pre><code class=\"language-bash\" data-line=\"\">reboot<\/code><\/pre>\n<p style=\"text-align: justify;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-8277\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/8-create-bash-script.png\" alt=\"\" width=\"825\" height=\"118\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/8-create-bash-script.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/8-create-bash-script-300x43.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/8-create-bash-script-762x109.png 762w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>Restarting the system by default runs the <strong>.profile <\/strong>script which adds the user\u2019s private <strong>bin directory <\/strong>to <strong>$PATH <\/strong>and makes the files inside the <strong>bin <\/strong>directory accessible for every shell session<strong>.<\/strong><\/p>\n<\/li>\n<\/ol>\n<h4><span class=\"ez-toc-section\" id=\"2_Executing_Script_to_Delete_Multiple_Users_in_Linux\"><\/span>2. Executing Script to Delete Multiple Users in Linux<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\">Upon rebooting the system, you will be able to run the \u201cdelete_users.sh\u201d script from any path under the current <strong>user account<\/strong>.<\/p>\n<p style=\"text-align: justify;\">To learn how you can execute a script for deleting multiple users, follow the process below:<\/p>\n<ol>\n<li>At first, press <strong>CTRL+ALT+T <\/strong>to open the <strong>Ubuntu Terminal<\/strong>.<\/li>\n<li>Run the previously written script by simply typing the file name.\n<pre><code class=\"language-bash\" data-line=\"\">delete_users.sh<\/code><\/pre>\n<\/li>\n<li>Type the number of users you want to delete and hit <strong>ENTER<\/strong>.\u00a0 For example, I will try to delete <strong>3<\/strong> users from my system. Therefore, I will type \u201c<strong>3<\/strong>\u201d and press <strong>ENTER<\/strong>.<\/li>\n<li>Now, type each <strong>username <\/strong>in response to the prompt message to delete and press <strong>ENTER<\/strong>.<\/li>\n<li>Finally, Input the <strong>password <\/strong>of the <strong>sudo <\/strong>user to run the <strong>userdel<\/strong> command written inside the script.\n<p style=\"text-align: justify;\"><div class=\"su-note\"  style=\"border-color:#cedfe2;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#E8F9FC;border-color:#ffffff;color:#333333;\">\n<strong>NOTE: <\/strong>To terminate the running script you can press <strong>CTRL+Z<\/strong> and achieve the deletion of a lesser number of users than you initially wanted.<br \/>\n<\/div><\/div>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8269\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/3-script-execution.png\" alt=\"Executing script for deleting multiple users in linux.\" width=\"825\" height=\"481\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/3-script-execution.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/3-script-execution-300x175.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/3-script-execution-767x447.png 767w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>In the above image, you can see that I have successfully deleted 2 users from my machine using the \u201cdelete_users.sh\u201d script. I also stopped the running script by pressing <strong>CTRL+Z <\/strong>which allowed me to delete only <strong>2 <\/strong>users even though initiated the deletion of <strong>3 <\/strong>users.<\/p>\n<\/li>\n<\/ol>\n<hr \/>\n<ul>\n<li><strong><a href=\"https:\/\/linuxsimply.com\/ubuntu-delete-user-account\/\" target=\"_blank\" rel=\"noopener\">How to Delete User Account In Ubuntu? [2 Methods]<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/linuxsimply.com\/ubuntu-server-delete-user\/\" target=\"_blank\" rel=\"noopener\">Delete a User from an Ubuntu Server in Just 3 Steps<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/linuxsimply.com\/gpasswd-remove-user-from-group\/\" target=\"_blank\" rel=\"noopener\">Remove User from a Group Using \u201cgpasswd\u201d Command in 3 Steps<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<h2><span class=\"ez-toc-section\" id=\"Complementary_Information\"><\/span>Complementary Information<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In addition to the specified method of <strong>deleting multiple users <\/strong>in <strong>Linux<\/strong>, you might find these supplementary tasks described here helpful as well.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Delete_User_Without_home_directory_in_Linux\"><\/span>Delete User Without home directory in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can choose to delete a user account without its corresponding files in your system. To achieve this, you will have to delete the user without its <strong>home directory<\/strong>. In this example, I will delete the \u201cUserC\u201d without its files.<\/p>\n<p style=\"text-align: justify;\">To delete a user without a home directory, follow the steps below:<\/p>\n<ol>\n<li>At first, open the <strong>Ubuntu terminal<\/strong>.<\/li>\n<li>Then, type the following command into the command prompt.\n<pre><code class=\"language-bash\" data-line=\"\">sudo userdel UserC<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>sudo<\/strong>: Grants administrative privileges.<\/li>\n<li><strong>userdel<\/strong>: Deletes a user account.<\/li>\n<li><strong>UserC<\/strong>: Username of the user to be deleted.<\/li>\n<\/ul>\n<\/div><\/div><\/li>\n<li>Press <strong>ENTER<\/strong>.<\/li>\n<li>Finally, provide the <strong>password <\/strong>of the currently logged-in user.<\/li>\n<li>Now, to check if the <strong>UserC home directory <\/strong>still exists, type the following and press <strong>ENTER<\/strong>.\n<pre><code class=\"language-bash\" data-line=\"\">ls \/home<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8270\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/4-delete-user-and-check-home-directory.png\" alt=\"Deleting user account without home directory\" width=\"700\" height=\"149\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/4-delete-user-and-check-home-directory.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/4-delete-user-and-check-home-directory-300x64.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/4-delete-user-and-check-home-directory-766x163.png 766w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>In the above image, you can see that I have deleted the user account \u201c<strong>UserC<\/strong>\u201d from my system but without the home directory of <strong>UserC<\/strong>.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Delete_Multiple_Users_From_a_Group_in_Linux\"><\/span>Delete Multiple Users From a Group in Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In <strong>Linux, <\/strong>there is no default command for removing multiple users from a group. But you can always edit the <strong>\/etc\/group <\/strong>file and remove multiple users from it.<\/p>\n<p style=\"text-align: justify;\">To delete multiple users from a group, open the file given below in a text editor and remove the user names within your desired group:<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8271\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/5-group-file-contents.png\" alt=\"Viewing \/etc\/groups file content\" width=\"825\" height=\"708\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/5-group-file-contents.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/5-group-file-contents-300x257.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/5-group-file-contents-768x659.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>In this example, the users \u201cUserA\u201d and \u201cUserB\u201d will be removed from the group \u201cmulti_users\u201d. You can do the same by following the process below.<\/p>\n<ol>\n<li>Open the <strong>Ubuntu terminal<\/strong>.<\/li>\n<li>Then, type the following command in the command prompt.\n<pre><code class=\"language-bash\" data-line=\"\">sudo nano \/etc\/group<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>sudo: <\/strong>Grants administrative privileges.<\/li>\n<li><strong>nano: <\/strong>Creates\/edits text files with Nano text editor.<\/li>\n<li><strong>etc\/group: <\/strong>A text file that contains all the group information.<\/li>\n<\/ul>\n<\/div><\/div><\/li>\n<li>Press the <strong>ENTER<\/strong> button.<\/li>\n<li>Then, give the <strong>password <\/strong>of the current user and hit <strong>ENTER<\/strong>.<\/li>\n<li>Erase the user names\u00a0 \u201c<strong>UserA<\/strong>\u201d and \u201c<strong>UserB<\/strong>\u201d from the group \u201c<strong>multi_users<\/strong>\u201d.<\/li>\n<li>To save and exit from the <strong>etc\/group <\/strong>file, press <strong>CTRL<\/strong>+<strong>S <\/strong>and <strong>CTRL+X <\/strong>respectively.<\/li>\n<li>Now, check the <strong>group members<\/strong> by typing the command below and then hit <strong>ENTER<\/strong>.\n<pre><code class=\"language-bash\" data-line=\"\">sudo less \/etc\/group| grep &quot;multi_users&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#E1E3E6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\"> EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<ul>\n<li><strong>sudo: <\/strong>Grants administrative privileges.<\/li>\n<li><a href=\"https:\/\/linuxsimply.com\/less-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>less<\/strong><\/a><strong>: <\/strong>Displays file contents in the terminal.<\/li>\n<li><strong>etc\/group: <\/strong>A text file that contains all the group information.<\/li>\n<li><a href=\"https:\/\/linuxsimply.com\/grep-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>grep<\/strong><\/a><strong>: <\/strong>Searches for a string inside a specified file.<\/li>\n<li><strong>multi_users:<\/strong> Name of the group from where to delete users.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><\/div><\/div>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8272\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/6-erasing-group-members.png\" alt=\"Erasing users from groups.\" width=\"825\" height=\"711\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/6-erasing-group-members.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/6-erasing-group-members-300x259.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/6-erasing-group-members-767x661.png 767w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>In the above image, you can see that I have deleted the users \u201cUserA\u201d and \u201cUserB\u201d from the group \u201cmulti_users\u201d. Furthermore, you can view the updated group members by combining the <strong>less <\/strong>and <strong>grep command<\/strong> for the group.<\/p>\n<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In this article, I have illustrated an automated way of deleting multiple users in <strong>Linux<\/strong>. As in <strong>Linux<\/strong>, it is not possible to apply a single command and remove multiple users simultaneously, therefore I have introduced <strong>a bash script<\/strong> to automate the process. Apart from this major task, I have also demonstrated some extra information to aid your experience with multiple users and groups. I hope this article will help you with your journey in <strong>Linux <\/strong>and make you a power user moving forward.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span>People Also Ask<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"What_is_the_command_to_delete_user_in_Ubuntu\"><\/span>What is the command to delete user in Ubuntu?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In <strong>Ubuntu<\/strong>, you can use the <strong>userdel command <\/strong>to delete users. The <strong>userdel command <\/strong>with option <strong>-r <\/strong>will delete the <strong>home directory <\/strong>of the user along with the user, whereas without the <strong>-r <\/strong>option only the user will be deleted.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_Remove_User_and_user_group_in_Ubuntu\"><\/span>How to Remove User and user group in Ubuntu?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To remove a user and the user group first you will need to log in to another user account that has access to <strong>sudo privileges<\/strong>. Then, you can use the <strong>userdel<\/strong>\/<strong>geoupdel command <\/strong>to delete a user and a user group according to your need.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_list_all_users_in_Ubuntu\"><\/span>How do I list all users in Ubuntu?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can list all the users in <strong>Ubuntu <\/strong>by displaying the <strong>\/etc\/passwd <\/strong>file contents. For displaying file contents you can use any text editor\/viewing command such as <strong>nano<\/strong>, <strong>cat<\/strong>, <strong>more<\/strong>, <strong>less<\/strong>, etc.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_bulk_delete_in_Linux\"><\/span>How do I bulk delete in Linux?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To bulk delete files in <strong>Linux<\/strong>, you will need to list the desired file names separated by spaces and apply the <strong>rm command<\/strong>. The <strong>rm command <\/strong>followed by name of the files will delete all the listed files.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_add_and_remove_users_in_Linux\"><\/span>How do I add and remove users in Linux?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can add a user to the <strong>Linux <\/strong>distribution using the <strong>useradd command<\/strong>. On the other hand, you can remove a user with the <strong>userdel command<\/strong>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_remove_a_user_from_login_screen_Linux\"><\/span>How do I remove a user from login screen Linux?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To remove a user from the login screen you can enable the <strong>HideUsers<\/strong> option in the <strong>\/etc\/sddm.conf<\/strong> file. All you need to do is open the <strong>\/etc\/sddm.conf<\/strong> file in a text editor then uncomment the <strong>HideUsers <\/strong>option and assign your desired user name to the <strong>HideUsers <\/strong>variable.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_remove_a_user_from_login_shell\"><\/span>How do I remove a user from login shell?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To remove a user from the login screen you can enable the <strong>HideShells<\/strong> option in the <strong>\/etc\/sddm.conf<\/strong> file. All you need to do is open the <strong>\/etc\/sddm.conf<\/strong> file in a text editor then uncomment the <strong>HideShells <\/strong>option and assign \u201c\/sbin\/nologin\u201d to the <strong>HideShells <\/strong>variable.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_can_I_see_all_Users_logged_in\"><\/span>How can I see all Users logged in?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong>Linux <\/strong>offers multiple commands to list all the currently logged-in users. You can run any of the following commands to view the logged-in users in your system: <strong>w<\/strong>, <strong>who<\/strong>, <strong>users<\/strong>, etc<br \/>\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [{\n    \"@type\": \"Question\",\n    \"name\": \"What is the command to delete user in Ubuntu?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"In Ubuntu, you can use the userdel command to delete users. The userdel command with option -r will delete the home directory of the user along with the user, whereas without the -r option only the user will be deleted.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How to Remove User and user group in Ubuntu?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To remove a user and the user group first you will need to log in to another user account that has access to sudo privileges. Then, you can use the userdel\/geoupdel command to delete a user and a user group according to your need.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How do I list all users in Ubuntu?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"You can list all the users in Ubuntu by displaying the \/etc\/passwd file contents. For displaying file contents you can use any text editor\/viewing command such as nano, cat, more, less, etc.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How do I bulk delete in Linux?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To bulk delete files in Linux, you will need to list the desired file names separated by spaces and apply the rm command. The rm command followed by name of the files will delete all the listed files.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How do I add and remove users in Linux?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"You can add a user to the Linux distribution using the useradd command. On the other hand, you can remove a user with the userdel command.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How do I remove a user from login screen Linux?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To remove a user from the login screen you can enable the HideUsers option in the \/etc\/sddm.conf file. All you need to do is open the \/etc\/sddm.conf file in a text editor then uncomment the HideUsers option and assign your desired user name to the HideUsers variable.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How do I remove a user from login shell?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To remove a user from the login screen you can enable the HideShells option in the \/etc\/sddm.conf file. All you need to do is open the \/etc\/sddm.conf file in a text editor then uncomment the HideShells option and assign \u201c\/sbin\/nologin\u201d to the HideShells variable.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How can I see all Users logged in?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"Linux offers multiple commands to list all the currently logged-in users. You can run any of the following commands to view the logged-in users in your system: w, who, users, etc\"\n    }\n  }]\n}\n<\/script><\/p>\n<p><span style=\"font-size: 18pt;\"><strong>Related Articles<\/strong><\/span><\/p>\n<ul>\n<li><strong><a href=\"https:\/\/linuxsimply.com\/ubuntu-delete-user-password\/\" target=\"_blank\" rel=\"noopener\">3 Ways to Delete the User Password in Ubuntu<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/linuxsimply.com\/ubuntu-mysql-delete-user\/\" target=\"_blank\" rel=\"noopener\">How to Delete MySQL User in Ubuntu? [2 Cases]<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/linuxsimply.com\/remove-user-from-group-in-linux\/\" target=\"_blank\" rel=\"noopener\">How to Remove A User from Group in Linux [4 Methods]<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/linuxsimply.com\/ubuntu-delete-user-and-all-files\/\" target=\"_blank\" rel=\"noopener\">How to Delete User and All Files in Ubuntu [3 Methods]<\/a><\/strong><\/li>\n<\/ul>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;8233&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;How to Delete Multiple Users in Linux? [2 Steps]&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Linux is a multiuser operating system. Therefore, you may want to delete multiple users along with creating them. Unfortunately, Linux &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Delete Multiple Users in Linux? [2 Steps]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#more-8233\" aria-label=\"Read more about How to Delete Multiple Users in Linux? [2 Steps]\">Read more<\/a><\/p>\n","protected":false},"author":314896,"featured_media":8274,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[81],"class_list":["post-8233","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-ubuntu-delete-user","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Delete Multiple Users in Linux? [2 Steps] - LinuxSimply<\/title>\n<meta name=\"description\" content=\"In Linux, to learn how to delete multiple users you must utilize bash scripting. Because there is no command for removing more than one user.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Delete Multiple Users in Linux? [2 Steps] - LinuxSimply\" \/>\n<meta property=\"og:description\" content=\"In Linux, to learn how to delete multiple users you must utilize bash scripting. Because there is no command for removing more than one user.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/profile.php?id=100005994046772&amp;mibextid=ZbWKwL\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-22T05:26:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-26T05:52:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/how-to-delete-multiple-users-feature-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Anonnya Ghosh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anonnya Ghosh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/\"},\"author\":{\"name\":\"Anonnya Ghosh\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/b53a69b64755f081b3c5951d72ba9c7c\"},\"headline\":\"How to Delete Multiple Users in Linux? [2 Steps]\",\"datePublished\":\"2023-03-22T05:26:08+00:00\",\"dateModified\":\"2023-12-26T05:52:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/\"},\"wordCount\":1894,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/how-to-delete-multiple-users-feature-image.png\",\"keywords\":[\"ubuntu delete user\"],\"articleSection\":[\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/\",\"name\":\"How to Delete Multiple Users in Linux? [2 Steps] - LinuxSimply\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/how-to-delete-multiple-users-feature-image.png\",\"datePublished\":\"2023-03-22T05:26:08+00:00\",\"dateModified\":\"2023-12-26T05:52:26+00:00\",\"description\":\"In Linux, to learn how to delete multiple users you must utilize bash scripting. Because there is no command for removing more than one user.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/how-to-delete-multiple-users-feature-image.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/how-to-delete-multiple-users-feature-image.png\",\"width\":400,\"height\":400,\"caption\":\"Deleting multiple users in linux.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/delete-multiple-users-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Delete Multiple Users in Linux? [2 Steps]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/b53a69b64755f081b3c5951d72ba9c7c\",\"name\":\"Anonnya Ghosh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Anonnya-Ghosh-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Anonnya-Ghosh-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Anonnya-Ghosh-II-96x96.png\",\"caption\":\"Anonnya Ghosh\"},\"description\":\"Hello there! I am Anonnya Ghosh, a Computer Science and Engineering graduate from Ahsanullah University of Science and Technology (AUST). Currently, I am working as a Linux Content Developer Executive at SOFTEKO. The strong bond between Linux and cybersecurity drives me to explore this world of open-source architecture. I aspire to learn new things further and contribute to the field of CS with my experience. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/profile.php?id=100005994046772&mibextid=ZbWKwL\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/anonnya-ghosh-6a934b211\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/anonya\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Delete Multiple Users in Linux? [2 Steps] - LinuxSimply","description":"In Linux, to learn how to delete multiple users you must utilize bash scripting. Because there is no command for removing more than one user.","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":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Delete Multiple Users in Linux? [2 Steps] - LinuxSimply","og_description":"In Linux, to learn how to delete multiple users you must utilize bash scripting. Because there is no command for removing more than one user.","og_url":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/profile.php?id=100005994046772&mibextid=ZbWKwL","article_published_time":"2023-03-22T05:26:08+00:00","article_modified_time":"2023-12-26T05:52:26+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/how-to-delete-multiple-users-feature-image.png","type":"image\/png"}],"author":"Anonnya Ghosh","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Anonnya Ghosh","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/"},"author":{"name":"Anonnya Ghosh","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/b53a69b64755f081b3c5951d72ba9c7c"},"headline":"How to Delete Multiple Users in Linux? [2 Steps]","datePublished":"2023-03-22T05:26:08+00:00","dateModified":"2023-12-26T05:52:26+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/"},"wordCount":1894,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/how-to-delete-multiple-users-feature-image.png","keywords":["ubuntu delete user"],"articleSection":["Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/","url":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/","name":"How to Delete Multiple Users in Linux? [2 Steps] - LinuxSimply","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/how-to-delete-multiple-users-feature-image.png","datePublished":"2023-03-22T05:26:08+00:00","dateModified":"2023-12-26T05:52:26+00:00","description":"In Linux, to learn how to delete multiple users you must utilize bash scripting. Because there is no command for removing more than one user.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/how-to-delete-multiple-users-feature-image.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/03\/how-to-delete-multiple-users-feature-image.png","width":400,"height":400,"caption":"Deleting multiple users in linux."},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/delete-multiple-users-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"How to Delete Multiple Users in Linux? [2 Steps]"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/b53a69b64755f081b3c5951d72ba9c7c","name":"Anonnya Ghosh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Anonnya-Ghosh-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Anonnya-Ghosh-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Anonnya-Ghosh-II-96x96.png","caption":"Anonnya Ghosh"},"description":"Hello there! I am Anonnya Ghosh, a Computer Science and Engineering graduate from Ahsanullah University of Science and Technology (AUST). Currently, I am working as a Linux Content Developer Executive at SOFTEKO. The strong bond between Linux and cybersecurity drives me to explore this world of open-source architecture. I aspire to learn new things further and contribute to the field of CS with my experience. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/profile.php?id=100005994046772&mibextid=ZbWKwL","https:\/\/www.linkedin.com\/in\/anonnya-ghosh-6a934b211"],"url":"https:\/\/linuxsimply.com\/author\/anonya\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/8233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314896"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=8233"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/8233\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/8274"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=8233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=8233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=8233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}