#!/bin/bash cd /home echo These are home directories with no account of the same name for i in * do if ! grep -q $i /etc/passwd; then echo $i fi done echo These are accounts in /etc/passwd that are disabled grep -v "/bin/bash" /etc/passwd | grep -v "/bin/tcsh" | grep -v "/bin/csh"