In a directory I have the following files with Messier object (M) data and NGC data. Any data which has been altered is marked with an ‘a’.
M01.txt
M41.txt
M81.txt
M81a.txt
M101.tbl
M105.txt
M105a.txt
M107.txt
NGC4791.txt
NGC4791a.txt
NGC6371.txt
1)I want a list of data for only objects with messier numbers 100 or greater, without alterations. Which of the following commands will produce such a list?
a) ls *
b) ls M1.txt
c) ls M1?.txt
d) ls M1??.
2) say I want to get the line count from each of the files selected in problem 1, what command could I run to achieve this? How could I redirect that information into a file?
Sorry for any formatting issues, I’m having to do this from my mobile phone.