Linear anomalies are important in the interpretation of gravity and magnetic data because they indicate some important structural features. In this study, a method is proposed to extract lineaments which may be difficult to recognize. It is based on the convolution between the templates obtained from the second horizontal derivative of the theoretical anomaly due to a truncated horizontal plate and the gravity anomaly. Local maxima of the gradient magnitude determine lineaments in a gravity anomaly map. The method is used in the edge detection of geological structures closer to the surface, which are masked by other structures with various depths and dimensions. A source code in Matlab format for the proposed algorithm is implemented. Firstly, it was tested on synthetic examples and satisfactory results were obtained. Secondly, it was tested on gravity-anomaly maps of the Tuzgolu (Salt Lake) basin in Central Anatolia, Turkey. Subsequently, the proposed algorithm and normalized standard deviation (NSTD), another edge-detection filter, were evaluated together to obtain the horizontal location of potential-field source boundaries. A visual evaluation of the outputs was carried out and the results compared with each other. These examples demonstrate that the proposed method can be used in the visual interpretation of gravity-anomaly maps in order to detect geological features such as major and minor faults.