bash - grep filename and grep in the file -
I have a file in which .txt is ending, but the name is always different from the first point. I want in the file where the name "http" changes, so it is not working unfortunately,
| Grep txt \\ | Grep "http" Edit: I have a passport:
Curl LS | Grep ".txt" | Xargs grep "http"
Error: Curl: (6) Host can not be solved: ls
curl printf "% s \ n" * .txt | Garg: "http"
Error:
Curl: (6) The host could not be resolved: printf curl: (6) The host could not be resolved:% s \ N curl: (6) Host can not be solved: * .txt grep: Invalid option - '-' Usage: grep [OPTION] ... PATTERN [FILE] ... For more information, 'grep - Try 'help'.
You can combine the find and grep You can use:
find / your / path-type f -name '* .txt' -exec grep http "{}" \; You can read this as "Your path is path / path which is a file whose name ends in .txt and run grep http on it".
Comments
Post a Comment