#!/bin/bash filename="your_document.txt" # 替换为你的文档路径 interval=3 # 每隔3行删除一行内容 awk "NR % $interval != 0" "$filename" > temp.txt mv temp.txt "$filename"