How to check user in /etc/passwd?

You can check for a specific user in the /etc/passwd file by using the grep command. Here’s how you can do it:

grep username /etc/passwd

Replace username with the actual username you want to check. This command will display the line corresponding to that user, which includes their user ID, group ID, home directory, and shell.

For example, to check for a user named john, you would run:

grep john /etc/passwd

0 Comments

no data
Be the first to share your comment!