I want to perform the following operations:
- Find/replace (using regexp) all occurrences of
<>:"\|?
and replace it with an empty string - Find/replace (using regexp) all occurrences of
^\.+|\.+$
and replace it with an empty string
As a test, I manually created 2 folders (see screenshot) and ran these:
find "/home/users/Downloads/test" -regextype sed -regex "*<>:\|?*" -type d
find "/Users/chiyo/Downloads/test" -regextype sed -regex "*[<>:\|?]*" -type d
find "/Users/chiyo/Downloads/test" -regextype sed -regex "[<>:\|?]" -type d
and didn't find any.
I'm using this version of find
.
=> find --version
find (GNU findutils) 4.6.0
Copyright (C) 2015 Free Software Foundation, Inc.
Any ideas how this can be done?
"*<>:\|?*"
looks closer to a shell glob than a regular expression - are you sure you understand the difference? – steeldriver Jul 02 '18 at 15:21sed
(mine isfind (GNU findutils) 4.4.2
) – ctrl-alt-delor Jul 02 '18 at 17:55rename
on you system? (Runwhich rename
, follow the bread crumbs, the have a look in-side. If it starts#!/usr/bin/perl
, then probably yes.) – ctrl-alt-delor Jul 04 '18 at 08:49