Written by Steve Perry
Published on

How to list all new and changed files in a Magento SUPEE patch

When patching a Magento website it’s useful to know which files are going to be affected so that you can run tests and check your custom template files. Here’s how to list all new and changed files in a Magento SUPEE patch file from the command line:

cat path/to/PATCH_SUPEE.sh | grep -E "diff[[:space:]]" | sed -E "s/.*[[:space:]](.*)/\1/g"

What we are doing is printing the contents of the patch file to the terminal with the cat command, we then pipe that to grep and search for all lines which have a the word “diff” followed by a space. Finally we pipe this to the sed command to give us just the part that we’re interested in.

Steve Perry Creative Ltd

Studio and registered office: 4 Back Lane, Brown Edge, Staffordshire ST6 8QS.

Copyright © 2012 – 2023 Steve Perry Creative Ltd., unless otherwise noted.

Registered in England & Wales, number 08354632.

Colophon

Typeset in Söhne Kräftig and Söhne Buch, by Klim Type Co.

Set as 32/64, 24/32, 20/32, and 12/16 on an 8px/96px grid.

Colour palette selected for AAA contrast.