我想制作脚本以提取linux服务器的用户,并检查“ /home/$user/public_html/vb/includes/config.php”是否存在,我希望脚本检查服务器中的所有用户并搜索所有用户中有许多文件
public_html/vb/includes/config.php
无论用户如何定义(/ etc / passwd,ldap,yp等),这都会在系统上每个用户的主目录中搜索
file="public_html/vb/includes/config.php"
for homedir in $(getent passwd | cut -d: -f6) ; do
f="${homedir}/${file}"
[ -e "$f" ] && echo "$f"
done
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句