sed s/[[:space:]]//g filename 删除空格 sed /^$/d filename 删除空行 sed '/ABCD/d' 文件名 删除文件中某行 sed '/ABCD/d' file1 >file2 删除文件中某行