Linux Logs Management Flashcards
What is the name of the logging daemon
Systemd-journald
or rsyslogd
Where is the rsyslogd config file?
/etc/rsyslog.conf
How would you structure an rsyslog rule
facility.priority action (the location to send the log)
what are 10 valid rsyslog facility codes?
auth
authpriv
cron
daemon
kern
lpr
mail
news
security
user
What are 8 valid rsyslog priority codes
listed lowest to highest
debug
info
notice
warning
err
crit
alert
emerg
What directory are log files usually sent to?
/var/log
How do you manage space the logs take up
Use logrotate
/etc/logrotate.conf
How do you securely remove a file (overwrite and obfuscate)
shred
Use -f to force permission changes to allow overwriting
Use -n to adjust number or overwrites (default 3)
What is a quick way of creating a new empty file?
touch NEWFILE
How might you keep an eye on a log file as it updates?
Tail -f FILE
-f (—follow)
How does “locate” command work?
It searches a daily updated database: mlocate.db
What are 3 commonly used options for the “locate” command?
-A Match all patterns
-b Only the file names, not directories
-i Ignore case
Name five useful options/expressions for the “find” command
-iname Search by name case-insensitive
- type File type i.e. f. d. l
- exec COMMAND{};
- mtime find files on modification time
- empty
- nouser
-perm
Access Execute mode in Vi
:
Access command mode in Vi
ESC