10-07-2008
or simply can i do the below check:
I have the timestamp of a file in a variable
ts="29 Sep 09:19"
How can I find out if this falls in last 7 days?
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in.
How can this be done?? Find returns files that I do not want. (2 Replies)
Discussion started by: halo98
2 Replies
2. UNIX for Dummies Questions & Answers
I have a requirement which will select the files with a specific naming convention which got created in past 7 days in a specific directory.Lets say the directory is /data/XYZ and the file names follow the below nomenclature like Daily_File*.txt
I just need to create one CSV file which will... (12 Replies)
Discussion started by: dr46014
12 Replies
3. Shell Programming and Scripting
hii all.
I have to get the date of the 7th day past from the current date.
if i give the current date as sep 3 then i must get the date as 27th of august.
can we get the values from the "cal" command.
cal | awk '{print $2}' will this type of command work.
actually my need is
if today is... (17 Replies)
Discussion started by: ladtony
17 Replies
4. Shell Programming and Scripting
Need to cpy those files which are created or modified in last 2 days.
bash$ ll -lrt
total 184
drwxr-xr-x 2 ons dce 256 Oct 12 06:58 files
-rw-r--r-- 1 ons dce 4313 Oct 14 06:06 cab.ksh
-rw-r--r-- 1 ons dce 6 Oct 14 07:03 Code.txt... (2 Replies)
Discussion started by: saluja.deepak
2 Replies
5. Shell Programming and Scripting
what is the find to command to find the files created last 30 days (5 Replies)
Discussion started by: rajkumar_g
5 Replies
6. Shell Programming and Scripting
Hi All,
I want to list file of LAST 7 days acc. to its modified date and then concatinate.
I have following piece of code..
For concatenate
cat file1 file2 >> Output (For concatinating)
find . -mtime -7 -exec basename {} \; (list past files but it is including . file also)
Plz... (4 Replies)
Discussion started by: vivek1489
4 Replies
7. UNIX and Linux Applications
One of my job is taking long running time.
I need to identify from the unix log file can you please help how to troubleshoot. (1 Reply)
Discussion started by: Nsharma3006
1 Replies
8. UNIX for Dummies Questions & Answers
Hello,
How to get the modified/created files past 2 hours in Solaris with find command?
Thank you. (7 Replies)
Discussion started by: balareddy
7 Replies
9. Shell Programming and Scripting
Hi ,
Can anyone help me how do perform below requirement in unix.
Step1:we will receive multiple files weekly with same name(as below) in a folder(In folder we will have other files also def.dat,ghf.dat)
Filenames:
1) abc_20171204_052389.dat
2)abc_20171204_052428.dat
DON'T modify... (23 Replies)
Discussion started by: sunnykamal59
23 Replies
TEST(1) General Commands Manual TEST(1)
NAME
test, [ - test for a condition
SYNOPSIS
test expr
[ expr ]
OPTIONS
(none)
EXAMPLES
test -r file # See if file is readable
DESCRIPTION
Test checks to see if files exist, are readable, etc. and returns an exit status of zero if true and nonzero if false. The legal operators
are
-r file true if the file is readable
-w file true if the file is writable
-x file true if the file is executable
-f file true if the file is not a directory
-d file true if the file is a directory
-s file true if the file exists and has a size > 0
-t fd true if file descriptor fd (default 1) is a terminal
-z s true if the string s has zero length
-n s true if the string s has nonzero length
s1 = s2 true if the strings s1 and s2 are identical
s1 != s2 true if the strings s1 and s2 are different
m -eq m true if the integers m and n are numerically equal
The operators -gt, -ge, -ne, -le, and -lt may be used as well. These operands may be combined with -a (Boolean and), -o (Boolean or), !
(negation). The priority of -a is higher than that of -o. Parentheses are permitted, but must be escaped to keep the shell from trying to
interpret them.
SEE ALSO
expr(1), sh(1).
TEST(1)