0

After using rsync --itemize-changes -i --recursive --checksum --dry-run to compare the contents of two drives, I got this kind of result:

2024/03/12 08:31:01 [15248] .d          Backups/Phone/Pictures/Screenshots/
2024/03/12 08:31:01 [15248] .f          Backups/Phone/Pictures/Screenshots/Screenshot_20190726-175033.png
2024/03/12 08:15:12 [15248] cd+++++++++ Backups/User profile/user/.mozilla/firefox/fk3vbf2j.Old profile/storage/default/https+++www.example.org/ls/
2024/03/12 08:15:12 [15248] cf+++++++++ Backups/User profile/user/.mozilla/firefox/fk3vbf2j.Old profile/storage/default/https+++www.example.org/ls/index.html

I'd like to filter out the non modified files and folders (the ones with .d and .f) with sed since the file was too big for a file editor.

1 Answers1

0
sed  '/[0-9\/]* [0-9:]* [[0-9]*] \.[fd]*[[:space:]]*.*/d' source_file > result_file

The result:

2024/03/12 08:15:12 [15248] cd+++++++++ Backups/User profile/user/.mozilla/firefox/fk3vbf2j.Old profile/storage/default/https+++www.example.org/ls/
2024/03/12 08:15:12 [15248] cf+++++++++ Backups/User profile/user/.mozilla/firefox/fk3vbf2j.Old profile/storage/default/https+++www.example.org/ls/index.html

I managed to make the regex thanks to these: