How can I get the name of a file in a directory on unix based on sed, grep, or awk in unix or linux?
I though I could do something like:
for i in $(ls /tmp/files/date*); do if [ $(cat $i | head -n 1 | grep -c "6") >= 1 ] ; then echo $i fi done
I need it to search all of the files in a certain directory (only the first line in them each) and then return which files have the string in them.
Thanks,
Tim