Linux Log Assistant
Linux Log Search and Archive Extraction Command Cheat Sheet
grep "keyword" /var/log/syslogSearch for lines containing the keyword in log files
grep -i "error" /var/log/syslogSearch for "error" ignoring case
grep -c "error" /var/log/syslogCount matching lines
grep -n "error" /var/log/syslogDisplay line numbers of matching lines
grep -C 3 "error" /var/log/syslogDisplay matching lines and 3 lines of context before and after
grep -B 5 "error" /var/log/syslogDisplay matching lines and 5 lines before
grep -A 5 "error" /var/log/syslogDisplay matching lines and 5 lines after
grep -v "debug" /var/log/syslogExclude lines containing "debug"
grep -r "error" /var/log/Recursively search all files in the directory
grep -l "error" /var/log/*Only display filenames containing matching content
grep -F "error" /var/log/*.logSearch for lines containing the fixed string "error" in log files (does not support regular expressions)
journalctl --since "2024-01-01 00:00:00"View logs after a specified time
journalctl --until "2024-01-01 23:59:59"View logs before a specified time
journalctl --since todayView today's logs
journalctl --since yesterday --until todayView yesterday's logs
journalctl --since "1 hour ago"View logs from the last 1 hour
journalctl --since "30 minutes ago"View logs from the last 30 minutes
sed -n '/Jan 01 10:00/,/Jan 01 12:00/p' /var/log/syslogExtract logs within a specified time range
awk '/2024-01-01 10:/ && /2024-01-01 12:/' /var/log/app.logFilter time range using awk
grep -E "error|warning|critical" /var/log/syslogMatch multiple keywords using regular expressions
grep -w "error" /var/log/syslogExactly match whole words
grep -E "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" /var/log/auth.logMatch IP addresses
grep -E "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}" /var/log/mail.logMatch email addresses
awk '{print $1, $2, $3}' /var/log/syslogExtract the first three fields of logs
awk '$9 >= 500' /var/log/nginx/access.logFilter requests with HTTP status code >= 500
sed 's/password=[^ ]*/password=****/g' /var/log/app.logReplace sensitive information in logs
cut -d' ' -f1,2,3 /var/log/syslogSplit by space and extract specified fields
tail -f /var/log/syslogReal-time log file tracking
tail -n 100 /var/log/syslogView the last 100 lines of logs
tail -f /var/log/syslog | grep --line-buffered "error"Real-time tracking and keyword filtering
tail -f /var/log/syslog /var/log/auth.logTrack multiple log files simultaneously
journalctl -fReal-time tracking of systemd logs
journalctl -u nginx.service -fReal-time tracking of logs for a specified service
less +F /var/log/syslogReal-time tracking using less (press Ctrl+C to stop, F to continue)
multitail /var/log/syslog /var/log/auth.logView multiple logs simultaneously in split-screen (multitail installation required)
cat /var/log/syslog | grep "error" | grep -v "debug"Combine multiple filter conditions
grep "error" /var/log/syslog | sort | uniq -c | sort -rnCount error occurrences and sort them
awk '{sum+=$10} END {print sum}' /var/log/nginx/access.logCalculate the sum of a field (e.g., response size)
find /var/log -name "*.log" -exec grep -l "error" {} \;Search across multiple log files
zgrep "error" /var/log/syslog.*.gzSearch compressed log files
zcat /var/log/syslog.1.gz | grep "error"Decompress and search compressed logs
find /var/log -name "*.log" | xargs grep "error"Batch search using xargs
grep "error" /var/log/syslog | tee errors.txtOutput search results to screen and file simultaneously
/var/log/syslogSystem log (Debian/Ubuntu)
/var/log/messagesSystem log (RHEL/CentOS)
/var/log/auth.logAuthentication log (login, sudo, etc.)
/var/log/secureSecurity log (RHEL/CentOS)
/var/log/dmesgKernel boot log
/var/log/kern.logKernel log
/var/log/nginx/access.logNginx access log
/var/log/nginx/error.logNginx error log
/var/log/apache2/access.logApache access log
/var/log/apache2/error.logApache error log
/var/log/mysql/error.logMySQL error log
docker logs <container_name>Docker container logs
πTool Introduction
Key Features
βFrequently Asked Questions
πRelated Tools
Cron Expression Parser
Validate cron syntax and preview upcoming schedules.
JSON to CSV
Convert JSON data to CSV format
JSON to YAML
Convert JSON data to YAML format
JSON to XML
Convert JSON data to XML format
YAML to JSON
Convert YAML configuration to JSON data
JSON Formatter
Format, validate and minify JSON data
JSON Visualizer
Display JSON data in tree structure
JSON Data Generator
Generate mock JSON data for testing
i18n JSON Translator
Translate entire JSON locale files in one go. Paste your base content, choose target languages, and the tool will call your OpenRouter-powered API with flattened keys.
JSON Diff Comparison
Compare differences between two JSON data
QR Code Generator
Generate custom QR code images
SVG Placeholder Generator
Generate custom SVG placeholder images
Base64 Image Converter
Convert images to Base64 encoding and vice versa
UUID Generator
Generate UUID unique identifiers in batch
Password Generator
Generate secure and reliable random passwords
Base64 Encoder/Decoder
Base64 string encoding and decoding tool
URL Encoder/Decoder
URL string encoding and decoding tool
MD5 Hash Generator
Generate MD5 hash values from text
SHA256 Hash Generator
Generate SHA256 hash values from text
SHA1 Hash Generator
Generate SHA1 hash values from text
Hex Encoder/Decoder
Hexadecimal string encoding and decoding tool
Binary Encoder/Decoder
Binary string encoding and decoding tool
AES Encrypt/Decrypt
AES symmetric encryption algorithm tool
RSA Encrypt/Decrypt
RSA asymmetric encryption algorithm tool
HMAC Generator
HMAC message authentication code generation tool
IP Address Lookup
Query geographical location and network information of IP addresses
Milliseconds Time Converter
Convert between millisecond timestamps and formatted date strings.