Tuesday, May 10, 2016

Linux : how to mail all files under a directory

the below command can help sending all the files under a directory

cd /location/where/files/are/present/
for file in .* *; do mailx -s "${file}" -a "${file}" <email@id> < ${file}; done

FYI : each file will be sent as separate email.

No comments:

Post a Comment