- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Help on deleting files
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
04-03-2009 12:36 PM
04-03-2009 12:36 PM
Help on deleting files
We have archives directory and trying get rid of lots of files but ll is talking too long to run and all the files in the directory are "0" size as far as I know.
We want to keep the files for year of 2009.
This is what I am trying to do but since "ll" is talking too long is not helping me out.
Does any guru's have better idea?
Appreciate your help and thanks in advance....MP
===============================
ll | grep “2007” | cut –c61-72 > /tmp/file1
for X in $(cat /tmp/file1)
do
rm ${X}
done
or other process is
cat /tmp/file1 | sed –e “s/^/rm ” > /tmp/file2 - and then run file2 as delete the files.
=======================================
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2009 12:43 PM
04-03-2009 12:43 PM
Re: Help on deleting files
Hey;
find . -mtime +93 -print | xargs -i rm {}
HTH;
Doug O'Leary
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2009 12:49 PM
04-03-2009 12:49 PM
Re: Help on deleting files
This will speed things up a bit, since one 'rm' process will remove multiple files instead of just one at a time:
# touch -amt 01010000 /tmp/ref
# find /path -type f ! -newer /tmp/ref -exec rm {} +
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2009 12:51 PM
04-03-2009 12:51 PM
Re: Help on deleting files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2009 09:59 AM
04-07-2009 09:59 AM