When doing the grep recursive command to search a string within files:
grep -r "height:" *.txt
aaa.txt:height: 15
bbb.txt:height: 12
ccc.txt:height: 17
Can we safely assume that grep will always list files in the same order (i.e. alphanumeric) each time?
.txtand all files in directories ending in.txt. The order of the files (if no matching directories found), is determined by bash. bash expands the*.txtand passes the list to grep. Try echo*.txt. bash will do all the work, echo does next to nothing. – ctrl-alt-delor Nov 23 '18 at 23:43