For example I have many files that look like the output below, I'm trying to get a list of all the unique file names but disregard the characters to the right of the "-". I have tried ls -la | grep ....- | sort --unique
and some variations but that does not give the output I need
4855-00160880.psi
4855-00160980.ps
4855-00160980.psi
5355-00160880.ps
5355-00160880.psi
5355-00160980.ps
5355-00160980.psi
5855-00160880.ps
5855-00160880.psi
5855-00160980.ps
5855-00160980.psi
5855-00160A80.ps
5855-00160A80.psi
Ideally I would like the output to show something like
4855
5355
5855
ls
, is it? – iruvar Apr 28 '17 at 18:37ls
, and probably acceptable in the OP's scenario. – tripleee Apr 28 '17 at 19:53