Hi
I am relatively new to unix. I need to write a unix script to get all the files which we are not receiving now, but we used to receive 4 months back. Usually we used to receive the files daily but now we are not receiving now.
I think the requirement is a little more complicated than that anyway. If you did want to use find like that you would have to protect the * using '*in'. Also the uniq is pointless since filenames are unique by definition.
How can you tell what date each file is for? Is it included in the filename, or are you going by the last modification date of each file?
I have a list of 1000 different files which comes daily to the directory.Some of
the files are not coming to the directory now.
I need to write a shell script to find the latest date and time of the files they
came to the directory. The files should be unique.
All the files ends with 'in'.
The output should somewhat look like this.
aeredrin Sep 1 time
agetrtin Aug 26 time
--------
---------
----------
---------
lkkjijin Mar 27 time
erwitein mar 1 time
--------
--------
--------
-------- and so on ...
The -ls option to find (if available) prints the date, size, and owner of each file in addition to the file name, just like the ls command. (You can use -exec ls -l {} \; as a workaround if your find doesn't have the -ls option.)
find /path/to/directory -name '*in' -ls
Like Annihilannic already remarked, file names are unique by definition.