- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find command
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
01-28-2002 09:08 AM
01-28-2002 09:08 AM
what am I doing wrong here. I'm running this command and it doesn't seem to be doing what I'm asking.
find /home/jonny -name test.log.* -type f -mtime +14 -exec rm -f {} ;
I am running this out of my home directory. Trying to find for the file and remove it if the file hasn't been modified in over 14 days. Any help will be greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 09:11 AM
01-28-2002 09:11 AM
Re: find command
I think you forgot the backslash at the end of your line before the ;
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 09:12 AM
01-28-2002 09:12 AM
Re: find command
find /home/jonny -name "test.log.*" -a -type f -a -mtime +14 -exec rm -f {} \;
instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 09:14 AM
01-28-2002 09:14 AM
Re: find command
Do you have the backslash at the command's end (before the semicolon)?
# find /home/jonny -name test.log.* -type f -mtime +14 -exec rm -f {} \;
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 09:14 AM
01-28-2002 09:14 AM
Re: find command
find /home/jonny -name "test.log.*" -type f -mtime +14 -exec rm -f {} ;
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 09:14 AM
01-28-2002 09:14 AM
Re: find command
I Think that:
find /home/jonny -name "test.log.*" -a -type f -a -mtime +14 -exec rm -f {} \;
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 09:15 AM
01-28-2002 09:15 AM
Re: find command
find: -exec not terminated with ';'
Probably a bad cut and paste ;-)
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 09:16 AM
01-28-2002 09:16 AM
Re: find command
Try this:
find /home/jonny -name "test.log.*" -type f -mtime +14 -exec rm -f {} \;
Best luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 09:18 AM
01-28-2002 09:18 AM
Re: find command
You have two problems:
1) As mentiopned you need the \ character before the ';'.
2) You need SINGLE QUOTES around your -n wildcard pattern because you do not want the shell toi expand the filename but rather you want to pass the wildcard string unmodified into find.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 09:38 AM
01-28-2002 09:38 AM
SolutionBill Hassell, sysadmin