The above command will give only the files which is present under your home directory
3) If you want to use only grep command, then first you have to find out the current hour using
4) Then read the lines one by one and extract the hour and do the comparsion. (But it is very tricky part), as you need to calculate and compare the date for some time (example : if the current time is 03:00, then you need to list the files which is having the time as 17:00 or less of last day )
5) Best approach is use find command instead of grep command.
For your home directory, instead of using /home/username, you should use the $HOME environment variable, which is almost* guaranteed to be set. Some (but not all!) shells support tilde expansion as in ~/ expands to ${HOME}/.
* There are some odd circumstances where this is not true, but you will likely not encounter them during your coursework.
HI Guys
I want to create date folder in unix base on currant date minus 12 hours.
Ex:
Currant date :07222013 and time is 1 Am
So the folder will create date :07212013 (6 Replies)
Is there an easy way to find files modified by hours? If you wanted to find something modified by like 28 hours then I know you could do this:
find . -mmin -1440It is pain to break out a calculator and calculate in minutes. Could you do something similar to this? I know I don't have the right... (1 Reply)
Hi Frens,
I want to list some files from a directory, which contains "DONE" in their name, i am receiving files every minute. In this i want to list all the files which are newer than 6 hours but older than 3 hours, of current time
i dont want my list to contain the latest files which are ... (4 Replies)
Hi All,
I have a requirement to find out the files which are modified in the last 10 minutes.
I tried the find command with -amin and -mmin options, but its not working on my AIX server.
Can anyone of you could help me.
Thanks in advance for your help.
Raju (3 Replies)