-2

I want to make the script to extract the users of linux server and check if "/home/$user/public_html/vb/includes/config.php" is exist , i want the script to check all the users in the server and search many files in all users

0

1 Answer 1

1

This will search for public_html/vb/includes/config.php in the home directory of every user on the system, no matter how they are defined (/etc/passwd, ldap, yp, etc)

file="public_html/vb/includes/config.php"
for homedir in $(getent passwd | cut -d: -f6) ; do
   f="${homedir}/${file}"
   [ -e "$f" ]  && echo "$f"
done

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.