How to list todays file in perticular folder
Do you mind explaining us what makes you thing this question should be in this sub-forum?
Sorry, its by mistake...
will take care of this point from next time. I didn't checked the proper forum
The find
command with the -[acm]min
or -[acm]time
test will do what is requested.
can u give me simple example... I am new to unix
find /path/to/folder -mmin -1440
For experts and even more for newbies the man
pages are an invaluable source of information on *nix commands. In your case, man find
will unveil a wealth of convenient topics/aspects.
Thanks Rudic ..
but instead of minute can we directly consider todays date ?
because here I have to calculate minutes for every time .
Did you try the command that RudiC suggested? On systems where the find
utility has a -mmin
, the command he suggested will give you a list of any files in the file hierarchy rooted in /path/to/folder
that are less than 1440 minutes old (i.e., less than 24 hours old OR within the previous "day"). On any system with a standards conforming find
utility, you could do the same thing with:
find /path/to/folder -mtime -1
Of course, since you haven't told us what operating system or shell you're using, we have know idea what specific options might or might not be available on your system.
If what you are looking for is files that have been modified since midnight of the current calendar date and you are using a POSIX-conforming shell, you might need something more like:
touch -t $(date +%Y%m%d0000) /tmp/timestamp.$$
find /path/to/folder -newer /tmp/timestamp.$$
rm -f /tmp/timestamp.$$
sorry I didn't mentioned ... currently I am not working on any OS, this is an interview question.