grep '^[0-9]' /home/shiyanlou/data2 > /home/shiyanlou/numgrep -E '^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$' /home/shiyanlou/data2 > /home/shiyanlou/mail 主要是. 这里有个难点,因为未必所有邮箱只有一个后缀,比如 edu.cn 。所以需要再在外层添加括号,并加上 + 。