How can you verify whether a user has been deleted?

QuestionsQuestions8 SkillsProUser Account ManagementAug, 08 2025
0197

You can verify whether a user has been deleted by checking the /etc/passwd file for the user's entry. Here's a simple script that checks if a user (for example, username) has been deleted:

#!/bin/bash

if ! grep -q '^username:' /etc/passwd; then
    echo "User 'username' has been deleted."
else
    echo "User 'username' still exists."
fi

Replace username with the actual username you want to check. If the user has been deleted, the script will output that the user has been deleted.

0 Comments

no data
Be the first to share your comment!