一、<? 輸入重定向
wc? ?-l? ? <? ?filelist .txt? ? ? ? ? ? ? ? 統計數據,從file這個文件拿結果。
二、tr 轉換字符命令
$ tr `A-Z``a-z`<.bash_profile? ? ? ? 將bash_profile文件中的大寫字符全部轉成小寫字符
三、管道符(|)
comand1 | comand2????????????????????將command1的輸出結果作為comand2的輸入
ps axo %cpu,%mem,pid,comm --sort=-%mem???|tee cpu11.txt |head -n 6 |tee cpu12.txt? ? ? ?
tee是將每一次過程結果保存下來,并繼續向后傳遞。如果使用重定向,該條命令則終止。??
四、過濾(grep)
cat? /etc/passwd? ?| grep? user1? ? 匹配passwd文件中,user1的內容
五、輸入追加<<
已EOF為起始符,EOF為結束符,將腳本內容直接追加并創建到鏡像文件當中
?#!/bin/bash? ?
cat > /etc/yum.repos.d/dvd.repo? << EOF
[Base0s]
name=Centos8
baseurl=file:///media/BaseOS
gpgcheck=0
EOF