Tuesday, November 30, 2010

removing all the files that belong to a username

In UNIX, you can remove all the files that are created by a user by using a the combination of "rm" and "find" commands.


The command below removes all the files belong to the user "Karriem" at /tmp folder. But it doesn't remove directories or the files inside the directories.

rm `find /tmp -user Karriem -maxdepth 1`

No comments:

Post a Comment