- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- delete a specific user file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 09:05 PM
06-08-2005 09:05 PM
delete a specific user file
ll /tmp
-rw-rw-rw- 1 userB edp 1830 Jun 9 16:25 abc.log
-rw-rw-rw- 1 userA edp 1864 Jun 9 16:25 ed.log
-rw-rw-rw- 1 edp1 sys 2546 Jun 9 16:04 gou.log
-rw-r--r-- 1 root root 27004 Jun 9 16:00 12203.1
-rw-r--r-- 1 root root 14683 Jun 9 16:00 12203.2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 09:22 PM
06-08-2005 09:22 PM
Re: delete a specific user file
use find.
#find
where
Regards,
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 09:22 PM
06-08-2005 09:22 PM
Re: delete a specific user file
ll | grep -i mad | awk '{ print $NF }'
Gives you all the files which a user owns.
Dartanan:/tmp> ll | grep -i mad | awk '{ print $NF }' | while read line
> do
> rm $line
> done
With this simple scritp you can delete all of them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 09:24 PM
06-08-2005 09:24 PM
Re: delete a specific user file
try following command
#find / -user abc -exec rm {} \;
replace abc with the username. Also replace / with the absolute path if you want to delete only from certain directory..
/ will delete all files owned by abc on the system.
Cheers !!!
eknath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 09:30 PM
06-08-2005 09:30 PM
Re: delete a specific user file
find
To delete userA file under /tmp structure then,
find /tmp -u userA -type f -exec rm -f {} \;
or
find /tmp -u userA -type f | xargs rm -f
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 09:55 PM
06-08-2005 09:55 PM
Re: delete a specific user file
ll |grep ^- | awk '{ if ( $3 == "username" ) {print $9} }'|xargs rm
for delete username' s ordinary file in the currently directory.
Enrico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 11:20 PM
06-08-2005 11:20 PM
Re: delete a specific user file
While i concur with the suggestions put forth in the previous posts, i would like to urge you to make doubly sure on the "User" and "Directory" while following the suggestions :)
regards
Mobeen