- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Find only Recently Created 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
Discussions
Discussions
Discussions
Forums
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
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-09-2006 10:42 PM
тАО01-09-2006 10:42 PM
How to find the file which are created recently,
for ex:
i would like to list the files created from past 10 min.
Thanks in advance !!
Best REgards,
GOvindaG.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 10:46 PM
тАО01-09-2006 10:46 PM
Re: Find only Recently Created Files
find /dir_name -newer ref_file
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 10:47 PM
тАО01-09-2006 10:47 PM
Re: Find only Recently Created Files
# find . -type f -ctime -1 -exec ll {} \;
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 10:51 PM
тАО01-09-2006 10:51 PM
Re: Find only Recently Created Files
# touch -t 0601101235 reffile
# find /directory -newer reffile -exec ls -l {} \;
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 10:52 PM
тАО01-09-2006 10:52 PM
Re: Find only Recently Created Files
find / -type f -mtime -1 -atime 1 -ctime 1 -print;
We can not specifically get newly created files with default commands informations. Some work around is needed.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 10:54 PM
тАО01-09-2006 10:54 PM
Re: Find only Recently Created Files
Check this thread
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=986260
Read A.Clay's rrply. it is not possible to find out the creation time in Unix only Last modifcation time.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 10:55 PM
тАО01-09-2006 10:55 PM
Re: Find only Recently Created Files
as unix does not itself store information about file creation, I am afraid it is not possible - unless you maintain a database of your own.
- sorry to be the bearer of bad news!
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 10:56 PM
тАО01-09-2006 10:56 PM
Re: Find only Recently Created Files
#!/bin/sh
find / -type f > /tmp/filebefore.log
sleep 600
find / -type f > /tmp/filenow.log
diff /tmp/filebefore.log /tmp/filenow.log | | grep -Ev '^[0-9]|filenow'
It is working.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 10:57 PM
тАО01-09-2006 10:57 PM
Re: Find only Recently Created Files
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 10:58 PM
тАО01-09-2006 10:58 PM
Re: Find only Recently Created Files
If you search for > then it is new files. Else if < then it is deleted.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 11:00 PM
тАО01-09-2006 11:00 PM
Solution#!/bin/sh
find / -type f > /tmp/filebefore.log
sleep 600
find / -type f > /tmp/filenow.log
echo "Newly created files"
echo
diff /tmp/filebefore.log /tmp/filenow.log | | grep -Ev '^[0-9]|filenow' | grep '>'
echo "Deleted files"
echo
diff /tmp/filebefore.log /tmp/filenow.log | | grep -Ev '^[0-9]|filenow' | grep '<'
PS: May be a problem with browser + refresh, too many replies :(
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 11:05 PM
тАО01-09-2006 11:05 PM
Re: Find only Recently Created Files
ll -rtl |grep "`date "+%b\ %d"`"
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 11:07 PM
тАО01-09-2006 11:07 PM
Re: Find only Recently Created Files
I really cant belive myself for having soo many replies..
Thanks a lot Guys !! i am really very Happy to see soo many replies..
I hope you have been rewarded with the right points.
But, Sad to know that its not possible to find at one step.
Muthu, thanks a lot for the workarounds.. i will implement this in my EnV and see how it works.
Thanks once again Guys for the Time u spent on this.
Cheers !!
GOvindaG.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-09-2006 11:22 PM
тАО01-09-2006 11:22 PM
Re: Find only Recently Created Files
The Workaround what u gave will find the files for the next 10 min, that means if i start the script now i will get the list for the next ten min. but is it possible to get the previous ten min ??
Any More inputs for that ??
Regards,
GovindaG.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2006 06:55 PM
тАО01-10-2006 06:55 PM
Re: Find only Recently Created Files
Logic is simple.
Generate a file with all files available at that moment. Generate available files list into new file and compare with first file list.
In this,
# Step 1
# It is having all files in the system
find / -type f > /tmp/filebefore.log
# 10 minute calculataion. May be you can change or remove it.
sleep 600
# To generate files list now
find / -type f > /tmp/filenow.log
Step 1 is most important. Based on the file informations in that only we can compare the new files list.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2006 06:59 PM
тАО01-10-2006 06:59 PM
Re: Find only Recently Created Files
#!/bin/sh
find / -type f > /tmp/filebefore.log
while [ 1 ]
do
# Change this time to your need. Presently 10 minutes
sleep 600
find / -type f > /tmp/filenow.log
echo "Newly created files"
echo
diff /tmp/filebefore.log /tmp/filenow.log | | grep -Ev '^[0-9]|filenow' | grep '>'
echo "Deleted files"
echo
diff /tmp/filebefore.log /tmp/filenow.log | | grep -Ev '^[0-9]|filenow' | grep '<'
# To generate new file information
mv /tmp/filenow.log /tmp/filebefore.log
clear
done
## END ###
exit 0
############
It will move recent file informations to old file in,
mv /tmp/filenow.log /tmp/filebefore.log step. If you want to compare always with old file list then comment that line.
It will run like top tool.
--
Muthu