Files availability with count in email

Hi all,

we have a requirement , we need to check the files availability in the unix folder and their record counts need to be emailed as attached format

Files	Count
File_1	123
File_2	1898
File_3	29
File_4	456
File_5	123

Welcome KK230689,

I have a few to questions pose in response first:-

  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)

Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.

We're all here to learn and getting the relevant information will help us all.

Kind regards,
Robin

Several points

I'm going to assume linux/bash, but you should tell us your OS and shell.
This command gives you the file name:

cd /path/to/files/I/want
stat -c "%n %s" $( find . -type f -name 'Files*' ) > /tmp/file.txt

Now you can search the forums here for how to send an email attachment using /tmp/file.txt. The idea is to get you to be somewhat self-sufficient, able to help yourself.

We are here to help you, but not write code for you. Show us what you have tried once you locate the command you need. If you need help scheduling the new script we can help with that as well.