LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-30-2016, 02:03 AM   #1
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Rep: Reputation: Disabled
-ctime +10 -exec rm {}


Hello,

Please let me know what is mean by -ctime +10. Is that to remove 10 days old *.dmp file?

Code:
find  /u01/app/oracle/admin/XE/dpdump/dmp -name '*.dmp*' -ctime +10 -exec rm {} \;
Best regards
 
Old 06-30-2016, 02:07 AM   #2
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,834

Rep: Reputation: 108Reputation: 108
Hya

Your friend
Code:
man find
can help you.

cheers
 
Old 06-30-2016, 02:13 AM   #3
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
man find is showing
Code:
 man find
FIND(1)                                                                FIND(1)

NAME
       find - search for files in a directory hierarchy

SYNOPSIS
       find [-H] [-L] [-P] [-D debugopts] [-Olevel] [path...] [expression]

DESCRIPTION
not able to execute accurate command to use man find what??

Please advise
 
Old 06-30-2016, 02:28 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This is a little easier to read http://linux.die.net/man/1/find, but 'man find' works as well.
You may not realise that its (man ) being output via a paging system. Try using space-bar or Return key to go through it.
 
Old 06-30-2016, 02:35 AM   #5
Raakh5
Member
 
Registered: Mar 2012
Posts: 174

Original Poster
Rep: Reputation: Disabled
Thanks

Code:
-daystart
Measure times (for -amin, -atime, -cmin, -ctime, -mmin, and -mtime) from the beginning of today rather than from 24 hours ago. This option only affects tests which appear later on the command line.
Now it means -ctime is begining of the the day rather then counting time but is that mean 12:00 AM +10 i.e. 22:00? So am i right that the following command will delete *.dmp files that are created at 22:00??

Code:
find  /u01/app/oracle/admin/XE/dpdump/medical -name '*.dmp*' -ctime +10 -exec rm {} \;
 
Old 06-30-2016, 07:31 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,328
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
Quote:
Originally Posted by Raakh5 View Post
So am i right that the following command will delete *.dmp files that are created at 22:00??

Code:
find  /u01/app/oracle/admin/XE/dpdump/medical -name '*.dmp*' -ctime +10 -exec rm {} \;
The -ctime +10 means files that are more than 10 days old as of the moment you run "find". If you add -daystart to the mix, you'll find files that are more than 10 days old as of the previous midnight. You might use -mtime instead though, since that will allow you to test files using "touch".

Code:
find  /u01/app/oracle/admin/XE/dpdump/medical -name '*.dmp*' -mtime +10 -exec ls -ldh "{}" \;
find  /u01/app/oracle/admin/XE/dpdump/medical -name '*.dmp*' -daystart -mtime +10 -exec ls -ldh "{}" \;
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rename and ctime whossa Linux - Software 6 11-17-2011 01:52 AM
How to use ctime(time.h) tnjones Programming 3 09-22-2008 08:29 PM
exec cmd=perl... work but exec cgi doenst crions Slackware 5 12-09-2005 12:17 PM
ctime of /etc/samba/smbpasswd different ddaas Linux - Security 0 07-04-2005 01:42 AM
Weired ctime() asctime() output azi Programming 1 07-01-2004 04:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration