As you might know, it's possible to create a home directory differ from "username". For example I can have a user named "john" which its home directory is: /home/jack
.
If you already know the user name, you could run:
echo ~username
It would print that specific user home directory. You can also run:
ls -ld /home/u942
or
stat -c %U /home/u942
to see which user owns this home directory then delete that user.
Also there is a chance that user is already deleted but its home directory not.
To find it out you can do something like:
id -un `stat -c %U /home/u942`
If it returned nothing it means the owner does not exist on your system. simply remove that directory If only you believe there is no important file there.
/home
? Is there a reason you think there's an account namedu942
in your system? – muru May 08 '17 at 08:30cut -d: -f1 /etc/passwd | grep u942
. (probably empty) – pLumo May 08 '17 at 08:32ls -lsd /home/u942
so we'll able to see the owner of this folder – Yaron May 08 '17 at 08:38