I have many folders with the following pattern:
$ ls
a-master 123-master abc123-master
I want them to be:
$ ls
a 123 abc123
During my research, I found this answer. But when I ran mv "$f" "${f/-master/}"
, I got mv: rename to : No such file or directory
error and I'm not sure why.
I found many answers recommending rename package but I don't prefer it. I think it's possible to be done just by using mv command but I'm not entirely sure how.
Does is possible? If possible, what is the correct command for this case?
I'm looking for one liner command, a short and sweet one.