You are using -o
option of grep
and only specifying one character, that is @
, also you don't need the -h
option.
Try this:
wget twitaholic.com/top100/followers/ | grep -o "@[^<]*"
What we are telling grep
here is look for @
symbol and capture everything until you see a <
symbol. This is because the line that carries the handle looks like this:
;@BarackObama<br
So you effectively need to extract text starting from @
to <
.
Output:
$ wget twitaholic.com/top100/followers/ | grep -o "@[^<]*" | head -10
@katyperry
@justinbieber
@BarackObama
@ladygaga
@YouTube
@taylorswift13
@britneyspears
@rihanna
@jtimberlake
@instagram