- 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
04-17-2002 06:02 AM
04-17-2002 06:02 AM
find . -atime -17 -exec ls -al {} \;
It returned everything not only April but also Jan. Feb...., what is the correct command to find those files only in April?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:08 AM
04-17-2002 06:08 AM
Re: find command
Use '-mtime' option:
# find . -mtime -17 -exec ls -al {} \;
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:09 AM
04-17-2002 06:09 AM
Re: find command
atime means acces time. You should try mtime (file modification time).
HtH,
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:10 AM
04-17-2002 06:10 AM
Re: find command
Eg : in /opt
# cd /opt
# touch 04010001 ref-file
# find . -newer ref-file -exec ls -al {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:11 AM
04-17-2002 06:11 AM
Re: find command
The find command is returning just what you asked. Find all the files that have been ACCESSED (-atime) in the past 17 days butr the ls command is displaying the modification times. It is entirely possible that a file has been recently accessed but last modified months ago. You probably want to use the find -mtime argument instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:12 AM
04-17-2002 06:12 AM
Re: find command
Should have said that you don't need the "-a ! -newer May" if you are checking for the current month"
find . -type f -newer /tmp/Mar
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:15 AM
04-17-2002 06:15 AM
Re: find command
If you are only interested in files then supply '-type f' to find or you could suppress the listing of the contents of directories with 'ls -ald {}'
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:24 AM
04-17-2002 06:24 AM
Re: find command
There is not reason to do a find followed to ll.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:54 AM
04-17-2002 06:54 AM
Re: find command
-mtime instead of -atime.
-atime is for accessed files for a particular period of time. This is the reason you are getting all files in your find result which you run the command.
-pap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 06:59 AM
04-17-2002 06:59 AM
Re: find command
I think Chan's method can work.
I have a test
You can do thie .. create a dummy reference file dated April 01 00:01 and use find command to list all files newer than that reference file.
#cd /
# touch 04010001 ref-file
# find . -newermm ref-file -print
note m - modified
or
#cd /
# touch 04010001 ref-file
# find . -newermm ref-file -print
try it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2002 07:46 AM
04-17-2002 07:46 AM
Re: find command
find . -type -f -mtime -17 -exec ls -al {} \;
-newer also can work.
Carlos, I like you idea, thanks!
Catherine, thanks a lot!
Thank you, all!