1、實(shí)驗(yàn)-輸出重定向
echo uos > test
cat test
echo bing > test
cat test
echo txuos >> test
cat test
2、實(shí)驗(yàn)-錯(cuò)誤重定向
wadwadwad 2> test
cat test
3、實(shí)驗(yàn)-雙重輸出重定向
find / -user uos > test
cat test
find / -name passwd 2> test
cat test
find / -name passwd &> test
cat test
find / -name passwd > test 2>&1
cat test
4、實(shí)驗(yàn)-輸入重定向
mail uos < test
su - uos
mail
cat > ok << EOF
123
456
EOF
cat ok
5、實(shí)驗(yàn)-管道
cat /etc/passwd | grep root
cat /etc/passwd | grep ^root
cat /boot/grub2/grub.cfg | grep -v ^# | grep -v ^$ > newgrub
cat /boot/grub2/grub.cfg | tee file1 | grep -v ^# | tee file2 | grep -v ^$ | tee file3 > newgrub
6、實(shí)驗(yàn)-文件操作命令
head /etc/passwd
head -n 5 /etc/passwd
tail /etc/passwd
tail -n 5 /etc/passwd
tail -f /var/log/message
wc -l /etc/passwd
sort -rnk 3 -t : /etc/passwd
uniq -c qintest
uniq -c qintest | sort
sort qintest | uniq -c
df -Th | grep sda2 | tr -s " " | cut -d " " -f 6 | cut -d "%" -f 1
paste file1 file2 file3
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。