HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- file removal command
Operating System - HP-UX
1832941
Members
2671
Online
110048
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
10-19-2000 11:24 AM
10-19-2000 11:24 AM
file removal command
I would like to prune our user directories of files that exceed a set limit ( ie, say no more than 50 files per user directory ). Preferably, the older files would be the ones being deleted. However, I do NOT want environmental files such as .profile and .cshrc to be deleted. Any ideas for commands/scripts that woudl accomplish this. Thanks in advance, Jonas
Buy low, sell high!
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2000 11:33 AM
10-19-2000 11:33 AM
Re: file removal command
Your best bet is the find command:
find /home -mtime +300 ! -name ".profile" ! -name ".sh_history" ! -name "on.and.on.and.on"... -exec ls -l {}\;
to preview and use the -exec rm {}\; construct to remove.
find /home -mtime +300 ! -name ".profile" ! -name ".sh_history" ! -name "on.and.on.and.on"... -exec ls -l {}\;
to preview and use the -exec rm {}\; construct to remove.
nothing wrong with me that a few lines of code cannot fix!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2000 11:36 AM
10-19-2000 11:36 AM
Re: file removal command
Hi:
I would think rather than abritrarly remove user's files by sheer number limits, you would want to remove (or MOVE elsewhere) files that haven't been accessed in some defined period of time. Consider, by way of example, only:
# find /mydir -atime +30 -exec rm {} \:
This would remove files from /mydir that haven't been accessed in 30-days. See the man page for 'find' for more options and examples.
...JRF...
I would think rather than abritrarly remove user's files by sheer number limits, you would want to remove (or MOVE elsewhere) files that haven't been accessed in some defined period of time. Consider, by way of example, only:
# find /mydir -atime +30 -exec rm {} \:
This would remove files from /mydir that haven't been accessed in 30-days. See the man page for 'find' for more options and examples.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2000 01:15 PM
10-20-2000 01:15 PM
Re: file removal command
what about using disk quota's to force the users to clean up their own messes ? We origionally had this problem with abusers in the /home filesystem and once disk quotas on were set the problem no longer existed and I do not have to baby sit anymore. Just an idea.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP