![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Include PERL script with in the unix shell script | ganapati | UNIX for Dummies Questions & Answers | 1 | 04-29-2008 01:18 PM |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 03:31 PM |
| FTP script for sending a file from one unix directory to another unix server director | raja_1234 | Shell Programming and Scripting | 1 | 11-30-2006 07:57 AM |
| how to convert unix .ksh script to windows .batch script | 2.5lt V8 | Shell Programming and Scripting | 1 | 11-28-2006 12:52 PM |
| check in unix shell script so that no one is able to run the script manually | adi_bang76 | Shell Programming and Scripting | 1 | 11-16-2006 10:43 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Unix script
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. All the filenames ends with 'in' . The files displayed should be unique. Please help ![]() |
|
||||
|
Hi,
try out this! Code:
find . -type f -name *in -mtime +120| sort | uniq Regards Dileep Pattayath |
|
||||
|
Hi everyone,
Please help 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 ... Each file as to appear only once in the list Thanks a lot .. |
|
||||
|
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? |
|
||||
|
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.)
Code:
find /path/to/directory -name '*in' -ls |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|