Thursday, January 17, 2019

How to delete a user in Linux | How to remove a user in Linux



How to delete a user in Linux
How to remove a user in Linux


To delete a user you must have root access. Then use this linux command 

[root@reyaz ~]# userdel test01

Note: By using this linux command you deleted only the user not deleted the user home directory.
see below image that showing we used command to delete the user but user home directory still now present. It's not deleted. 




To delete a user home directory you should use the linux command  "rm -rf /home/test01"
Now see the below image.



In this above image there is no test01 user home directory. 


Steps: 
[root@reyaz ~]# userdel test01
[root@reyaz ~]# ls /home/
applmgr  appsdba  oracle  oracle1  rhossan  test01


[root@reyaz ~]# rm -rf /home/test01/
[root@reyaz ~]# ls /home/
applmgr  appsdba  oracle  oracle1  rhossan




You can find me on Fiverr & LinkedIn


No comments:

Post a Comment