jNerd
jNerd

Reputation: 191

How to remove custom string entries from a host files using cmd?

I've entered the following into the hosts file
127.0.0.1 www.facebook.com 127.0.0.2 www.youtube.com
how can I delete the above entries from the file using cmd?

Upvotes: 0

Views: 2129

Answers (1)

user4104817
user4104817

Reputation:

An ugly solution:

find /v "facebook" hosts | find /v "youtube" hosts > hosts

/V Displays all lines NOT containing the specified string.


see the documentation for find (ss64) system utility

Upvotes: 3

Related Questions