how do I extract all "http[s]://+/" from files in a tree, and print only those urls,…
- User
how do I extract all "http[s]://+/" from files in a tree, and print only those urls, from cli
Assistant
You can use
grepwith recursive search to extract URLs from all files in a directory tree. Here are a few approaches:Basic approach:
bashgrep -r -o 'https\?://[^[:space:]]*' /path/to/directoryThis will:
-r: Search recursively through all files-o: Print only the matching parts (not the whole line)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.