qq_37666688
qq_37666688
2018-12-28 17:06
采纳率: 66.7%
浏览 1.9k

sed命令和awk命令练习

假设文件file.txt的内容如下所示.
1 This is the first line.
2 Hello, Everybody!
3 192.168.1.1 www.suda.edu.cn
4 lijunhui:x:504:504::/home/lijunhui:/bin/bash

写出如下两条命令的运行结果 :
(1) sed 's/suda//g' file.txt

(2) awk 'NR==2, NR==3 {print $1, $3}' file.txt

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • x20121223
    wersdfadaf 2018-12-28 11:46
    已采纳

    第一题答案:
    1 This is the first line.
    2 Hello, Everybody!
    3 192.168.1.1 www..edu.cn
    4 lijunhui:x:504:504::/home/lijunhui:/bin/bash
    第二题答案:
    2 Everybody!
    3 www.suda.edu.cn

    点赞 评论
  • devmiao
    devmiao 2018-12-28 09:07
    点赞 评论

相关推荐