使用find命令将找到特定用户拥有的所有文件和目录,并执行rm命令以删除它们。
# find /home/-user student -exec rm -fr {} \;
以下Linux命令类似,它将搜索属于student组的文件和目录:
# find /home/-group student -exec rm -fr {} \;
但是,如果您试图从系统中删除用户及其文件和目录,您可能会发现deluser命令也很有用。
deluser将从系统中删除用户,并删除与此用户关联的所有文件。
# deluser --remove-all-files student
日期:2020-07-07 20:56:30 来源:oir作者:oir