awk用法
用法 awk
2023-09-27 14:27:44 时间
grep:文本过滤器,
grep "pattern" input_file ....
sed: 流编辑器;
sed "command/PATTERD/"
awk:报告生成器。能够将输入的信息格式化之后显示;包括nawk版本,gawk版本
用法:
awk [option] 'script' file1 file2, ...
awk [option] 'PATTERN {action}' file1, file2. ...
print, printf
1 root@ubuntu-ceph-07:~# echo "this is a test" >>test.txt 2 root@ubuntu-ceph-07:~# awk '{print $0}' test.txt 3 this is a test 4 root@ubuntu-ceph-07:~# awk '{print $1}' test.txt 5 this 6 root@ubuntu-ceph-07:~# awk '{print $2}' test.txt 7 is 8 root@ubuntu-ceph-07:~# awk '{print $1$2}' test.txt 9 thisis 10 root@ubuntu-ceph-07:~# awk 'BEGIN{OFS="#"}{print $1,$2}' test.txt 11 this#is 12 root@ubuntu-ceph-07:~# awk '{print $1,$2}' test.txt 13 this is 14 root@ubuntu-ceph-07:~# awk 'BEGIN{OFS=":"}{print $1, $2, $3, $4}' test.txt 15 this:is:a:test 16 root@ubuntu-ceph-07:~# awk 'BEGIN{OFS=":"}{print $1, $2, "AAAAAAA",$3, $4}' test.txt 17 this:is:AAAAAAA:a:test
地址:http://edu.51cto.com/lesson/id-17373.html
meetup
firebug
相关文章
- jupyter 基本用法
- delphi:TStringList 的详细用法(转载)
- 【Qt开发】foreach用法
- 【精通Linux系列】Linux核心数据处理查找命令之find,cut,awk, sed命令用法
- STL其他--<tuple>用法【C11】
- amixer的用法
- SQLPLUS SQLCMD连接管理oracle sqlserver的简单用法
- spring的@Transactional注解详细用法
- 详解Vue中watch的高级用法
- js中!和!!的区别及用法【转】
- C++ 中常用关键字及其用法
- Linux系统stat指令用法
- springMVC之mvc:interceptors拦截器的用法
- extern "C"用法
- c/c++ define用法
- oracle系统包——dbms_random用法
- C++11 auto关键字的用法