Updated on 2025-03-31 GMT+08:00

Deleting Files

Deleting Uploaded Files

Delete files uploaded to the VM, such as the .rpm packages of bms-network-config and SDI drivers.

Deleting Temporary Files

  1. Run the following commands to delete user login records:

    echo > /var/log/wtmp

    echo > /var/log/btmp

  2. Run the following commands to delete temporary files:

    rm -rf /var/log/cloud-init*

    rm -rf /var/lib/cloud/*

    rm -rf /var/log/network-config.log

    rm -rf /opt/huawei/network_config/network_config.json

  3. Delete residual configurations.
    • SLES

      Check for the files whose names start with ifcfg in the /etc/sysconfig/network-scripts/ folder and delete them except ifcfg-lo and ifcfg.template.

      • Run the following command to view files:

        ll /etc/sysconfig/network/

      • Run the following command to delete files:

        rm -rf /etc/sysconfig/network/ifcfgxxx

    • RHEL, CentOS, Oracle, or EulerOS

      Check for the files whose names start with ifcfg in the /etc/sysconfig/network-scripts/ folder and delete them except ifcfg-lo and ifcfg.

      • Run the following command to view files:

        ll /etc/sysconfig/network-scripts/

      • Run the following command to delete files:

        rm -rf /etc/sysconfig/network-scripts/ifcfgxxx

    • Ubuntu

      rm -rf /etc/network/interfaces.d/50-cloud-init.cfg

  4. Run the following command to delete operation records:

    history -w;echo > /root/.bash_history;history -c;history -c;history -c;