10-18-2009
Calculating the difference between dates
Hello!
i need to find files lower and bigger that one date i pass, i search in the man find, but i didn't find anything, the only that i find is the parameter -mtime, in this parameter i can pass a number of days, but i need to know the difference between dates, any built-in function for do this? or any parameter for pass to the find command?
Thanks!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Wish you a Happy New year...
I have to find the difference between two dates, the result should be the number of days. I have seen the "datecalc" function. Its good, can I have any other alternative.
Thanks in Advance
Raju (4 Replies)
Discussion started by: rajus19
4 Replies
2. Shell Programming and Scripting
Hi,
I has created the shell script in HP_UX 11.23 and using the command, echo $(date +%Y%m%d%H%M%S) > $DIR/alert, placing the time of running the script into a file alert.
I want to compare the time in the above file alert with the current time.If difference is more than 5 min, then print the... (7 Replies)
Discussion started by: velocitnitin
7 Replies
3. Shell Programming and Scripting
Hi,
I have a file with the contents as following
Access Time: Thu Nov 6 16:43:45 2008
Modify Time: Thu Nov 6 16:43:45 2008
Change Time: Thu Nov 6 16:43:45 2008
Access Time: Thu Nov 6 16:43:02 2008
Modify Time: Thu Nov 6 16:44:01 2008
Change Time: Thu Nov 6 16:44:01 2008
I need... (3 Replies)
Discussion started by: meetmano143
3 Replies
4. UNIX and Linux Applications
Hi
I have a table with name, date in format DD.MM.YYYY.
I need to something like this (I try to explain in pseudo code)
if SYSDATE (current date) minus 6 months > $expiry date
print OK
else print NOK with $name and $expiry date
I know this is possible with Oracle. How to do this... (0 Replies)
Discussion started by: slashdotweenie
0 Replies
5. Shell Programming and Scripting
Hi All,
I have a txt file which has hundreds of lines and 41 fields. I have a requirement to pick up field 14 from the text file which is a date fiels in the following format.
Field 14 :
Data Type : NUMERIC DATE (YYYYMMDD)
Field Length : 8
Example of Data :20090415
Field 42 :
Data Type... (2 Replies)
Discussion started by: nua7
2 Replies
6. UNIX for Advanced & Expert Users
A report needs to come some what similar to this
No of elements Stream Batch No Load time
A B C D
A,B,C im able to get quite easily
wc -l /usr/local/intranet/areas/prod/output/SRGW_0?/*/MESSAGE_T.dat
O/P of above command.
A B C ... (1 Reply)
Discussion started by: peckenson
1 Replies
7. Shell Programming and Scripting
hi all,
I need a help for below requirement.
Difference between two dates"12-11-2009" and "03-25-2012" (mm-dd-yy format") in weeks and days and hours
Please help me for this. Thanks in adv....
I am working in AIX, so dont have below command:-
date --version (2 Replies)
Discussion started by: gani_85
2 Replies
8. Shell Programming and Scripting
Hi all,
I have a requirement to calculate the difference of number of days of time stamp of a file and system date and if the difference is greater than 15 days it should prompt as previous month file otherwise current month file.
Below is the code i used and it is working fine till now. (You... (2 Replies)
Discussion started by: Ravindra Swan
2 Replies
9. UNIX for Beginners Questions & Answers
Hi There
I am trying to find the difference between two dates in seconds, by taking the first 10 digits of the file name itself, which I have done as shown below:
current_time=`date +%s`
last_login_of_tim=`date -d @1489662376 +%s`
diff_sec=$(($current_time-$last_login_of_tim))
... (5 Replies)
Discussion started by: simpsa27
5 Replies
10. Shell Programming and Scripting
16:45:51 10051 77845
16:45:51 10051 77845
16:46:52 10051 77846
16:46:53 10051 77846
Match the last PID then subtract second line time with first line.
Please help me with any command or script.
working in media company on a project OS: RHEl7
tried command:
awk 'function... (2 Replies)
Discussion started by: vivekn
2 Replies
Commands Reference, Volume 1, a - c
apropos_Command
Purpose
Locates commands by keyword lookup.
Syntax
apropos [ -M PathName ] Keyword ...
Description
The apropos command shows the manual sections that contain any
of the
keywords specified by the Keyword parameter in their title.
The apropos
command considers each word separately and does not take into
account if a
letter is in uppercase or lowercase. Words that are part of
other words
are also displayed. For example, when looking for the word
compile, the
apropos command also finds all instances of the word compiler.
The
database containing the keywords is /usr/share/man/whatis,
which must
first be generated with the catman -w command.
If the output of the apropos command begins with a name and
section
number, you can enter man Section Title. For example, if the
output of the
apropos command is printf(3), you can enter man 3 printf to
obtain the
manual page on the printf subroutine.
The apropos command is equivalent to using the man command
with the -k
option.
Note: When the /usr/share/man/whatis database is built from
the HTML
library using the catman -w command, section 3 is equivalent
to section
2 or 3. See the man command for further explanation of sec-
tions.
Flag
Specifies an alternative search path. The search
path is
-M PathName specified by the PathName parameter, and is a
colon-separated
list of directories.
Examples
1. To find the manual sections that contain the word password
in their
titles, enter:
apropos password
2. To find the manual sections that contain the word editor
in their
titles, enter:
apropos editor
File
/usr/share/man/whatis Contains the whatis data-
base.
Related Information
The catman command, man command, whatis command.
________________________________________________________________________________
Commands Reference, Volume 1, a - c
apropos_Command
Purpose
Locates commands by keyword lookup.
Syntax
apropos [ -M PathName ] Keyword ...
Description
The apropos command shows the manual sections that contain any
of the
keywords specified by the Keyword parameter in their title.
The apropos
command considers each word separately and does not take into
account if a
letter is in uppercase or lowercase. Words that are part of
other words
are also displayed. For example, when looking for the word
compile, the
apropos command also finds all instances of the word compiler.
The
database containing the keywords is /usr/share/man/whatis,
which must
first be generated with the catman -w command.
If the output of the apropos command begins with a name and
section
number, you can enter man Section Title. For example, if the
output of the
apropos command is printf(3), you can enter man 3 printf to
obtain the
manual page on the printf subroutine.
The apropos command is equivalent to using the man command
with the -k
option.
Note: When the /usr/share/man/whatis database is built from
the HTML
library using the catman -w command, section 3 is equivalent
to section
2 or 3. See the man command for further explanation of sec-
tions.
Flag
Specifies an alternative search path. The search
path is
-M PathName specified by the PathName parameter, and is a
colon-separated
list of directories.
Examples
1. To find the manual sections that contain the word password
in their
titles, enter:
apropos password
2. To find the manual sections that contain the word editor
in their
titles, enter:
apropos editor
File
/usr/share/man/whatis Contains the whatis data-
base.
Related Information
The catman command, man command, whatis command.