歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Sed & Awk每日一例之一

Sed & Awk每日一例之一

日期:2017/3/1 15:17:01   编辑:關於Linux
Sed & Awk每日一例之一 1、sed [options] {sed-commands} {input-file} sed -n 'p' /etc/passwd 2、sed [options] -f {sed-commands-in-a-file} {input-file} $ vi test-script.sed /^root/ p /^nobody/ p $ sed -n -f test-script.sed /etc/passwd 3、sed [options] -e {sed-command-1} -e {sed-command-2} {input-file} sed -n -e '/^root/ p' -e '/^nobody/ p' /etc/passwd sed -n \ -e '/^root/ p' \ -e '/^nobody/ p' \ /etc/passwd 4、sed [options] '{ sed-command-1 sed-command-2 }' input-file sed -n '{ /^root/ p /^nobody/ p }' /etc/passwd
Copyright © Linux教程網 All Rights Reserved