How to check user exists or not in Linux

In this article, we will see how to check user exists or not in Linux. Using grep command, we can check the user exists or not in Linux.

1. Lets create user using useradd.

useradd kalpesh

2. Verify the above user exists or not by using Linux more command.

more /etc/passwd | grep kalpesh

3. Verify the above user exists or not by using Linux cat command.

cat /etc/passwd | grep kalpesh

So in this article, we covered two methods to check user exists or not in Linux.