RT,需要注释某个用户用如下命令

sed -i '/^test/s/^/#/' /etc/passwd