Tuesday, June 18, 2013

UNIX/Linux Shell Script to delete multiple users

Example 1:

To delete the users: dummy1, dummy2, dummy3, dummy4 and dummy5

for  counter in {1..5}; do userdel dummy$counter; done

It can also be written as,

for counter in {1..5}
       userdel dummy$counter

NOTE: {1..5} syntax will not work in certain shell. But it will work definitely in bash.

Example 2:

cat > user.list

for  user in `cat  user.list`;do userdel $user;done


Oracle Fusion said...

It is really very excellent; I find all articles were amazing. Awesome way to get more tips from everyone............... R12 Financials Online Training

Isabella Olivia said...

This information is impressive; I am inspired with your post writing style & how continuously you describe this topic.

Pawn Shop

Pawn Loans

Pawn Shops

Pawn Loan

Pawn Shop near me