I
I
Ivan2020-09-14 09:37:51
bash
Ivan, 2020-09-14 09:37:51

Grep only first value from files?

Please tell me, is it possible to do grep -h -r date document.xml, but only the first value that is in the document, and ignore the rest occurring after?
Thanks in advance!

UPD
Thank you, it works, but if I search in all files in a subdirectory, and there are 29 of them,
grep -h -r xdms:date */*document.xml | head -n 1

then prints only the first value from the first file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lesha, 2020-09-14
@hydrugz

grep -h -r date document.xml | head -n 1
?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question