Files
error-in-logs/error-in-logs.sh
2024-06-17 13:05:42 +02:00

11 lines
222 B
Bash

#!/bin/bash
# Define the log file to search
log_file="/var/log/syslog"
# Define the error keyword to search for
error_keyword="ERROR"
# Should return the line(s) with ERROR in them.
grep -n "$error_keyword" "$log_file"