View Orphan Home Directories
I realized my script for deleting users was not working properly. For some reason it did delete the user account from the system but did not use the 'userdel -r' command. I think I may have left some home directories in the system that are from old deleted accounts. Is there a command or way I can see what directories under /home are not tied to accounts that are in /etc/passwd?
|
here's a "base" way to do it
grep home /etc/passwd > file1 ls -b /home > file2 diff -y file1 file2 I'm sure you could clean this up by replacing the grep with an awk or sed command. |
Code:
#!/bin/bash |
Thanks for the awesome info all!
|
All times are GMT -5. The time now is 04:17 PM. |