Jump to content

Command Crate ¿about?

Remove lines containing 'monday' or 'tuesday' from log/text files (find, sed)

find ~/logs/{daily,monthly,weekly} -type f \( -name "*.log" -o -name "*.txt" \) | xargs sed -i -E '/monday\|tuesday/Id'

Searches log and text files in daily, monthly, and weekly directories, and deletes lines containing 'monday' or 'tuesday', case-insensitively.

log management [kb:16]