Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Deleting Files By Username, Can it be done?
brock
post Sep 29 2005, 08:23 AM
Post #1


Grub-er
**

Group: Members
Posts: 29
Joined: 15-July 05
Member No.: 5,271



I'm sure it can be done, but I'm new to Linux!

I want to delete a load of files in /tmp directory which have been created by a user - how do I do this?

I've looked in man for rm but cannot find much in there.
Go to the top of the page
 
+Quote Post
Termina
post Sep 29 2005, 09:22 AM
Post #2


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



CODE
for x in `find /tmp -user your_user`
do
rm -rf $x
done


You can do that in the terminal, or in a bash script.


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post
brock
post Sep 30 2005, 10:57 AM
Post #3


Grub-er
**

Group: Members
Posts: 29
Joined: 15-July 05
Member No.: 5,271



Thanks for that.

I've found that 'find -user 'user_name' -exec rm -rf {} /; -print' seems to work for the mo.

The foward slash is actually a backslash but for some reason this NG won't allow a backslash.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th October 2017 - 11:25 AM