I've a data files with information like this :
977.txt:ahdcompany@yemen.net.ye
977.txt:ahemdrasheed@yemen.nrt.ye
980.txt:ahmedmohammed@y.ne.ye
982.txt:qfofs@yemen.net.ye
985.txt:agencysabaship@y.net.ye
987.txt:aghani@y.net.ye
987.txt:agk46@india.yellowpages.net.com
991.txt:aige_yemen@y.net.ye
991.txt:aige_yemen@y.net.ye
991.txt:aihaidechenmo@163.yeah.net
994.txt:qichange@163.yeah.net
995.txt:aina@email.yes
999.txt:aisco@y.net.ye
i want to remove everything before : how can i do that for all files in directory ( Linux ).
i've tried this, and it's working but i'm unable to use it with multiple files:
grep -o - '[[:alnum:]+\._\-]*@[[:alnum:]+\._\-]*' file.txt
grep -h
so that the file names are not displayedgrep
to create the file? If so, consider usinggrep -h
to avoid prefixing the matches with the filename. You then wouldn't need to post-process it.