This Bash script iterates over each disk partition and checks its filesystem type. If the partition has a Linux filesystem (ext4, xfs, btrfs), the script fetches its creation date using the dumpe2fs
command. The script then logs this information to a file named particiones_fechas.log
.
- Bash
dumpe2fs
utility- Superuser permissions
- Clone the repository or download the Bash script to your local machine.
- Open the terminal and navigate to the directory where the script is saved.
- Run
chmod +x obtener_fechas_particiones.sh
to make the script executable.
- Open your terminal and navigate to the directory containing
obtener_fechas_particiones.sh
. - Run the script using superuser permissions:
sudo ./obtener_fechas_particiones.sh
.
After running the script, you will find a log file named particiones_fechas.log
in the same directory. This file will contain the creation date of each Linux filesystem partition that the script iterated over.
This script requires superuser permissions to execute dumpe2fs
. Make sure you understand the risks associated with running commands as a superuser.
Yeah boi!