You can create a node set and then query it to know the number of elements that it contains. This number will also be displayed when you finish selcting nodes for the set. There are various ways of quickly selecting multiple nodes but in this case, since you want to know the number of nodes along a path (line) you can use „Select nodes for the set: by feature edge”). It will only allow you to select nodes belonging to the model edges so if you want to count nodes along some arbitrary path you will have to use another method. Individual node selection possibly.
Another, more complicated way would be to create a literal Path in Abaqus/Viewer after the analysis. Then create XY Data for this path (including intersections), save it, click its name with right mouse button and select Edit. In the table you will see how many points are there with the results. This is the number of nodes along the path.