This repository contains a Bash script designed to monitor and report on file system and disk usage changes over time. It was developed as a project for the "Basic Tools and Techniques in Informatics (ITBI)" course at the University of Bucharest.
The main script, fdum.sh, analyzes and compares typescript files (generated by the script command) to identify what has changed between different shell sessions.
Core Features
File & Directory Analysis: Compares ls -l outputs from two different snapshots and reports:
Added files/directories
Removed files/directories
Disk Usage Monitoring: Compares df command outputs to identify changes in mounted filesystems, such as:
Added mount entries
Removed mount entries
Flexible Comparison Modes:
Compare multiple typescript files against each other.
Compare one or more typescript files against the current live state of the system using the --current flag.
Smart Parsing: Uses grep, awk, and sed to intelligently parse the typescript files, extracting only the relevant ls -l and df command outputs for comparison.
How to Use
The script takes one or more typescript files as arguments.
- Compare two typescript files:
This will show the differences between session1.txt and session2.txt.
bash fdum.sh session1.txt session2.txt
- Compare a typescript file to the current system:
This will show the differences between session1.txt and the live output of ls -l and df.
bash fdum.sh --current session1.txt
- Compare multiple files:
This will compare all possible pairs of the provided files (file1 vs. file2, file1 vs. file3, file2 vs. file3).
bash fdum.sh file1.txt file2.txt file3.txt
Technical Details
Language: Bash
Core Utilities: The script relies on standard Unix utilities, including:
comm (to find differences in sorted files)
sort
grep
awk
sed
mktemp (for handling temporary files)