杩欎釜鍛戒护鐨勫姛鑳戒篃寰堝ソ璁帮紝鍥犱负瀹冨姛鑳藉緢鏈夐檺锛?/span>
wc -c filename锛氭樉绀轰竴涓枃浠剁殑瀛楄妭鏁?/span>
wc -m filename锛氭樉绀轰竴涓枃浠剁殑瀛楃鏁?/span>
wc -l filename锛氭樉绀轰竴涓枃浠剁殑琛屾暟
wc -L filename锛氭樉绀轰竴涓枃浠朵腑鐨勬渶闀胯鐨勯暱搴?/span>
wc -w filename锛氭樉绀轰竴涓枃浠剁殑瀛楁暟
[rocrocket@rocrocket programming]$ cat wc1.txt
1 2
34 5
浣犲ソ
[rocrocket@rocrocket programming]$ wc -c wc1.txt
16 wc1.txt聽
[rocrocket@rocrocket programming]$ wc -m wc1.txt
12 wc1.txt聽
[rocrocket@rocrocket programming]$ wc -l wc1.txt
3 wc1.txt聽
[rocrocket@rocrocket programming]$ wc -L wc1.txt
4 wc1.txt聽
[rocrocket@rocrocket programming]$ wc -w wc1.txt
5 wc1.txt
姣忚缁撳熬鐨勬崲琛岀涔熺畻涓€涓瓧绗︼紝绌烘牸涔熺畻涓€涓瓧绗︺€?/span>
鐢变簬閲囩敤UTF-8缂栫爜锛屾墍浠ヤ竴涓眽瀛楀湪杩欓噷琚浆鎹负3瀛楄妭锛屾墍浠c -c鏄剧ず鐨勭粨鏋滄槸16锛屽嵆鈥滅涓€琛岀殑4涓瓧鑺傦紜绗簩琛岀殑5涓瓧鑺傦紜绗笁琛岀殑7涓瓧鑺傗€濓紳4+5+7=16銆?/span>
聽
鑰屽綋浣跨敤-m閫夐」鏃讹紝涓€涓眽瀛楀氨浣滀负涓€涓瓧绗﹁绠楋紝鎵€浠ユ槸4+5+3=12銆?/span>
褰撲娇鐢?L鏃讹紝鏄粰鍑烘渶闀胯鐨勯暱搴︼紝绗簩琛屾渶闀匡紝鏈?涓瓧绗﹂暱銆傦紙鏄剧劧鏄笉鎶婃崲琛岀璁$畻鍦ㄥ唴锛?/span>
浣跨敤-w鏄绠楀瓧鏁帮紝涓€涓瓧鏄竴涓獁ord锛屾墍浠モ€?4鈥濊〃绀轰竴涓獁ord锛屼竴涓€滀綘濂解€濊〃绀轰竴涓獁ord(鎴戣瘯杩囦簡锛屽綋涓枃鏄繛鍦ㄤ竴璧风殑锛屼笉绠″灏戜釜锛屽湪璁$畻瀛楁暟word鏃讹紝鍙湁涓€涓?锛屽洜姝?+2+1=5銆?/span>
鎻掑瓟璇磋tab鍒惰〃绗︼紝杩欎釜绗﹀彿姣旇緝鐗规畩锛屽綋浣跨敤-L鏃讹紝鍒惰〃绗︾畻7涓瓧绗︼紙杩欒渚濇嵁涓€涓埗琛ㄧ鐨勯暱搴﹁€屽畾锛屽湪鎴戠殑绯荤粺涓竴涓埗琛ㄧ绠?涓┖鏍奸暱搴︼級銆傝€屽綋浣跨敤-w鏃讹紝鍒惰〃绗﹀拰绌烘牸娌℃湁涓ゆ牱锛岄兘浣滀负瀛楃殑闂撮殧鏉ョ湅寰呫€傚綋鐢?c鏃讹紝涓€涓埗琛ㄧ涔熷氨绠椾竴涓瓧绗︼紝鍥犱负瀹冪殑纭氨鍙槸涓€涓瓧绗﹁€屽凡銆?/span>
濡傛灉浣犵洿鎺ユ墽琛寃c wc1.txt锛屽垯鏄剧ず锛?/span>
[rocrocket@rocrocket programming]$ wc wc1.txt 3聽 5 16 wc1.txt
杈撳嚭淇℃伅渚濇鏄細琛屾暟 瀛楁暟 瀛楄妭鏁?鏂囦欢鍚嶇О銆?/span>