Open mikuQ opened 3 months ago
-n:显示匹配的行号 -i:忽略大小写 -r :递归搜索目录中的文本文件 -l:只列出包含匹配文本的文件名 -v:反选只显示不匹配的行 -c:只计算匹配的行数不是显示行内容
grep "miku" /etc/passwd
grep -in "Miku" /etc/passwd
grep -rn "miku" /etc
awk -F: '{print $1}' /etc/passwd
sed -i 's/old/new/g' miku.txt
sed -i '22s/enforcing/disabled/' /etc/selinux/config
提取存储设备UUID
空格
[root@RedHat ~]# blkid | grep "sr0" | awk '{print $2}' >> cdrom_uuid [root@RedHat ~]# cat cdrom_uuid UUID="2023-04-13-16-58-02-00"
分区使用率 df -m | grep -v "^/dev/loop" | grep -v "/mnt/" | grep -v "/POME/" | awk 'NR!=1 {printf "%-15s%-15s%-15s%-15s\n",$2,$4,$5,$6}'
df -m | grep -v "^/dev/loop" | grep -v "/mnt/" | grep -v "/POME/" | awk 'NR!=1 {printf "%-15s%-15s%-15s%-15s\n",$2,$4,$5,$6}'
grep "miku" /etc/passwd
grep -in "Miku" /etc/passwd
grep -rn "miku" /etc
awk -F: '{print $1}' /etc/passwd
sed -i 's/old/new/g' miku.txt
sed -i '22s/enforcing/disabled/' /etc/selinux/config
提取存储设备UUID
空格
作为分隔符