I have some text file like this
access-2018-08-21.log.1-20180906
access-2018-08-22.log.1-20180906
I want to remove the -20180906 part wo the result would be
access-2018-08-21.log
access-2018-08-22.log
I tried rename -- "s/\-20180906//g" * but it didn't work.
What's the command line i need to achieve my goal?