一、本文介绍
1. 作业详解
二、具体内容
第一题:
mkdir -p /data/666
echo "内容" >> 777.txt (使用vim 也行)

第二题:
awk -F "[ :]+" '{print $3" "$5" "$7}' 777.txt # []中为匹配的多个条件(有空格和:),$3" "$5" "$7为IP的位置。双引号里面的内容为所见即所得(正则除外)。


第三题
mv /data/666 /tmp
cp /etc/passwd /tmp/666

第四题
awk -F ":" 'NR>9 && NR<21 {print $3}' passwd >> /tem/666/777.txt

第五题
alias rm='echo 内容'
echo "alias rm='echo 内容'" >> /etc/bashrc /etc/profile # 永久生效需要添加到相关配置文件中。


第六题
find /tmp/666 -type f ! -name "passwd" | xargs \rm -f

第七题
head -5 /etc/passwd | tail -3
sed -n '2,5p' /etc/passwd
awd 'NR>1 && NR<6' /etc/passwd

第八题


第九题


第十题
find /oldboy -type f -name "*.log" -size +1M -mtime +7


第十一题
7个级别。


第十二题
下载到内存 存到硬盘的过程为buffer
硬盘读取到内存中,不用到硬盘中读取,过程为cache

第十三题
<<EOF #追加内容后EOF结束


网友评论