Trying to delete a user and home directory

Good Afternoon,

I'm trying

userdel -r username

on Solaris 9 and getting

UX: userdel: ERROR: unable to find status about home directory: No such file or directory

I see the user's home directory and

getent passwd

shows the user

Anybody know what's causing it?

$ man userdel
...
     - r   Remove the user's home directory from the system. This
           directory  must exist.
...

Create the homedirectory in case it does not exist:

#!/bin/ksh
#!/bin/bash
mkdir -p ~username
userdel -r username

Or run userdel without the -r !
Or try the -r first, and retry without the -r

userdel -r username; if [ $? -eq 12 ]; then userdel username; fi
1 Like

Never mind.. The user had an unusual home directory in

passwd

, even though he had files in

/home

---------- Post updated at 01:49 PM ---------- Previous update was at 01:46 PM ----------

Thanks MadeInGermany.. I deleted the files I found and then ran

userdel

without the

-r