Rotate logs manually linux
Force log rotation regardless of schedule
logrotate -f /etc/logrotate.conf
more linux
all 133 commands →
List cron jobs system-wide
for u in $(cut -f1 -d: /etc/passwd); do crontab -l -u $u 2>/dev/null | grep -v '^#' | sed "s|^|$u: |"; done
Cron expression tester
systemd-analyze calendar '*/5 * * * *'
Redirect stderr to file
command > /tmp/out.log 2> /tmp/err.log
Capture both streams
command 2>&1 | tee /tmp/all.log
Replace string in files recursively
grep -rl 'old_string' /etc/ | xargs sed -i 's/old_string/new_string/g'