linuxsed文件内容
发布时间: 2024-11-02 23:15:41
① 濡备綍鍦↙inux涓浣跨敤sed锻戒护鍦ㄦ枃浠剁壒瀹氲屽悗娣诲姞鍐呭癸纻
Linux涓镄剆ed锻戒护鏄涓绉嶅己澶х殑鏂囨湰澶勭悊宸ュ叿锛岄氲繃鑴氭湰镎崭綔瀹炵幇瀵规枃链鏂囦欢镄勭紪杈戝拰杞鎹銆傚叾涓昏佸姛鑳藉寘𨰾镊锷ㄥ寲鏂囦欢缂栬緫銆佺亩鍖栭吨澶嶆搷浣滃拰缂栧啓杞鎹㈢▼搴忋傚熀链璇娉曟牸寮忎负锛歴ed [鍙傛暟]锛屽叾涓涓浜涘父鐢ㄧ殑鍙傛暟鍖呮嫭锛
- -e鎴--expression=script锛氱洿鎺ュ湪锻戒护涓鎸囧畾鑴氭湰澶勭悊鏂囨湰鏂囦欢銆
- -fscript鏂囦欢鎴--file=script鏂囦欢锛氢娇鐢ㄥ栭儴鑴氭湰鏂囦欢杩涜屽勭悊銆
- -h鎴--help锛氭樉绀哄府锷╀俊鎭浠ヤ简瑙e懡浠ょ敤娉曘
- -n鎴--quiet鎴--silent锛氢粎鏄剧ず澶勭悊钖庣殑缁撴灉锛屼笉鏄剧ず榛樿ょ殑琛屽彿銆
- -V鎴--version锛氭煡鐪媠ed镄勭増链淇℃伅銆
涓嬮溃鏄涓浜涘疄闄呮搷浣灭殑渚嫔瓙锛
- 鍦╢ile鏂囦欢镄勭锲涜屽悗鎻掑叆涓琛岋细钬淗ELLO LINUX! Linux is a free unix-type operating system. This is a Linux test file!钬濓细sed -e Ɗa ewlineHELLO LINUX! Linux is a free unix-type operating system. This is a Linux test file!' file
- 鍒楀嚭/dir鐩褰曞唴瀹癸纴鍒犻櫎绗2~5琛岋纴钖屾椂鏄剧ず琛屽彿锛歯l/dir | sed ƈ,5d'
- 鍦ㄧ浜岃屽悗闱㈡坊锷犱袱琛屾枃瀛楋细钬淒rink tea or 钬..钬濆拰钬渄rink beer钬濓细nl/dir | sed ƈaDrink tea or ......drink beer?'
- 灏嗙2-5琛屾浛鎹涓衡淣O 2-5 number钬濓细nl/dir | sed ƈ,5cNO2-5number'
- 鎸夎屼负鍗曚綅鏄剧ず绗5鍒7琛岋细nl/dir | sed -n Ƌ,7p'
阃氲繃杩欎簺瀹炰緥锛宻ed锻戒护镄勫己澶у姛鑳藉拰𨱔垫椿镐у湪鏂囨湰鏂囦欢镄勫勭悊涓鏄惧缑灏や负鏄捐宪锛岃兘澶熸弧瓒冲悇绉嶅嶆潅镄勬枃链镎崭綔闇姹伞
热点内容