1. 程式人生 > 實用技巧 >linux的基本命令(二)

linux的基本命令(二)

四、字數統計@
[[email protected] ~]# wc [選項] [檔名]
選項:
-c 統計位元組數
-w 統計單詞數
-l 統計行數

五、多命令執行@
在這裡插入圖片描述
例子:
[[email protected] ~]# ls ; date ; cd /user ; pwd
[[email protected] ~]# dd if=輸入檔案 of=輸出檔案 bs=位元組數 count=個數
選項:
if=輸入檔案 指定原始檔或源裝置
of=輸出檔案 指定目標檔案或目標裝置
bs=位元組數 指定一次輸入/輸出多少位元組,即把這些位元組看做
一個數據塊
count=個數 指定輸入/輸出多少個數據塊

例子:
[[email protected] ~]# date ; dd if=/dev/zero of=/root/testfile bs=1k count=100000 ;
date

六、管道符@
2、管道符
命令格式:
[[email protected] ~]# 命令1 | 命令2
#命令 1 的正確輸出作為命令 2 的操作物件
顏色顯示
例子:
[[email protected] ~]# ll -a /etc/ | more
[[email protected] ~]# netstat -an | grep “ESTABLISHED”