Alex Rivera | Logout

How to remove a word prefix using grep?

Asked 2012-07-26T15:56:29.453
16

How can I remove the beginning of a word using grep? For example, I have a file that contains this:

www.abc.com

I only need the this part:

abc.com

Sorry for the basic question, but I have no experience with Linux.

Edit
Report

1 Answer

1

grep is not used to manipulate/change text, only to search for text/patterns within text

You should look into something like sed or awk or cut if you want a command line tool to do it. Or write a script in Python/Perl/Ruby/whatever.

answered 2012-07-26T16:00:59.407

Your Answer