I have a file which contains lines like those:
-rw-rw-rw 1 root root 6379 May 24 2016 test1.CSV
-rw-rw-rw 1 root root 23249 May 25 2016 test2.CSV
-rw-rw-rw 1 root root 2995 May 26 2016 test3.CSV
and I need to keep just the CSV file names. I have to use a regex but I don't know which one.
The expected result is "test1.CSV \n test2.CSV \n test3.CSV".
ls
instead ofls -l
? – Sjoerd Apr 16 '19 at 09:59for file in *.csv; do ...; done
, for example, instead of storing thels -l
orls
output. – Kusalananda Apr 16 '19 at 10:03ls
(and what do to instead)? – JigglyNaga Apr 18 '19 at 09:34