1
I'm using Mac. I have a directory in which the files have names like ABC_2016-06-08_09-23.csv
. I want to extract the part of each file name before the first underscore. I tried doing ls | awk -F_ "{print $1}"
but I got back the full file names. What am I doing wrong?