Saturday, February 24, 2024
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 4628  / 3 Years ago, sun, july 11, 2021, 10:26:23

I have a list of n number (n is known) of URLs. How can I remove the protocol name from the URL?


Eg : from https://xyz.com, I want to fetch xyz.com part only.


More From » command-line

 Answers
1

Using GNU grep and PCRE matching,


grep -oP 'https://KS+' file

That outputs the non-spaces following "https://"


[#2776] Sunday, July 11, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skaing

Total Points: 462
Total Questions: 124
Total Answers: 113

Location: Nauru
Member since Thu, Feb 2, 2023
1 Year ago
;