- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find cmd to search for files older than 90 days
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-22-2005 04:33 AM
04-22-2005 04:33 AM
Hello All,
I need to figure out a way locate all files
under /auditlog/usrlog that are over 90 days old ? I tried the "find" cmd, but it shows current files also. The "file" cmd indicates these are "data" files.
*******************************************
root[/auditlog/usrlog]
# find /auditlog/usrlog -type f -mtime +90 -exec ll \; | more
Mar 14 2004 c4c6669.3142004.a09940
-rw------- 1 root root 2272 Mar 26 2004 c4c6669.3262004.a06653
-rw------- 1 root root 4086 May 16 2004 c4c6669.5162004.a03889
-rw------- 1 root root 2983 Apr 20 12:40 j4s9389.4202005.a09390
-rw------- 1 root root 2986 Apr 21 07:18 j4s9389.4212005.a23144
-rw------- 1 root root 3280 Apr 21 07:34 j4s9389.4212005.a23186
***********************************
# file j4s9389.4212005.a23144
j4s9389.4212005.a23144: data
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:37 AM
04-22-2005 04:37 AM
Re: find cmd to search for files older than 90 days
find . -type f -mtime +90 -print
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:38 AM
04-22-2005 04:38 AM
Re: find cmd to search for files older than 90 days
find /auditlog/usrlog -type f -mtime +90 -exec ll {} \;
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:40 AM
04-22-2005 04:40 AM
Re: find cmd to search for files older than 90 days
find /auditlog/usrlog -type f -mtime +90 -print -exec ll {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 04:42 AM
04-22-2005 04:42 AM
Re: find cmd to search for files older than 90 days
Besides what Rick points out you also need an operator and an expression - like:
find . \( -type f -a -mtime +90 \) -print
Note that the parens need to be escaped & the -a is an and operator.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2005 06:52 AM
04-22-2005 06:52 AM
Re: find cmd to search for files older than 90 days
Here is a user friendly script.
###########################################################
#This script finds recenty created large files
#
#Syamkumar
#TCSL
#26/01/2004
#
#
rm -f find.out
echo
echo "Enter directory to search"
read DIRNAME
if [ ! -d $DIRNAME ]
then
echo "Error: directory $DIRNAME does not exist"
exit 1
fi
echo
echo "How large a file do you want to look for ? (in Kbytes)"
read SIZE
echo
echo "How many days since the file was created ?"
read DAYS
echo
echo "Searching..."
find $DIRNAME -type f -size +$SIZE -mtime -$DAYS -exec ls -ls {} \; | sort -n -r | tee find.out
echo
echo "Done"
echo
echo "Note: output in find.out"
echo
########################################################
Regards,
Syam