[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing file names with "--" to "-"
From: |
Emanuel Berg |
Subject: |
Re: Changing file names with "--" to "-" |
Date: |
Sun, 21 Feb 2021 04:33:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
wael-zwaiter wrote:
> I have a lot of files and want to change "--" to "-".
>
> Am using
>
> rename 's/--/-/g' *
>
> on the current directory.
>
> How can I recursively go through all sub directories and do
> the changes for files only.
In zsh you can use **/* to get recursion, then exclude
directories from the match with the glob qualifier (.), i.e.
**/*(.)
So try
$ rename 's/--/-/g' **/*(.)
--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal