Clearing System Logs
Delete log files and historical records, and stop the ECS.
- Run the following commands to delete redundant key files:
echo > /$path/$to/$root/.ssh/authorized_keys
An example command is echo > /root/.ssh/authorized_keys.
echo > /$path/$to/$none-root/.ssh/authorized_keys
An example command is echo > /home/linux/.ssh/authorized_keys.
- Run the following command to clear log files in the /var/log directory:
rm -rf /var/log/*
Before deleting log files, back up log directories and log files required by application startup. For example, if the default Nginx log directory /var/log/nginx is deleted, Nginx may fail to be started.
- Run the following commands to delete historical records:
history -c
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.