Find the shortest tooth.
Mark this as a guide tooth. According to its length, the length of all the other teeth are aligned on the chain. With filing, return to this tooth and file all of the other teeth on the length of the sharpened tooth.
Tighten the guide rail in accordance with the position of the target tooth in a vise.