where:
"ecomm" is part of the name of the file in which we should search for the string
"Aug 27" is the date the files were last modified
"$10" is the last column resulting from the "ls -las" command, this is the column containing the filename (the string is not searched for yet)
"string_to_search_for" the name is obvious :)
"\.log" all the files end with ".log"
"$1" is the filename containing the string
There are still two problems left (I don't have time right now to solve them):
- All the filenames end with the ":" character, it needs to be omitted
- Filenames are redundant, i.e. each file is repeated many times
find . -name "*" | grep -i ecomm | xargs ls -las | grep "Aug 31" | awk '{print $10}' | xargs grep -i mbassiouny | grep -i "\.log" | awk '{print $1}' | sort | uniq
No comments:
Post a Comment