uos 输入输出与重定向

1、实验-输出重定向
echo uos > test
cat test
echo bing > test
cat test
echo txuos >> test
cat test
2、实验-错误重定向
wadwadwad 2> test
cat test
3、实验-双重输出重定向
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、实验-输入重定向
mail uos < test
su - uos
mail

cat > ok << EOF
123
456
EOF
cat ok
5、实验-管道
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、实验-文件操作命令
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
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容