Skip to content
WJunction - Webmaster Forum

Debian - command line. Replace () in filenames with _

Status
Not open for further replies.
Hi,

I've got a set of directories like this:
files\
files\a
files\b
etc...
files\z
files\0

In these directories there might be files with the following characters: ()
I need those characters replaced by underscores: _

Someone gave me the following command:
Code:
find ./ -type f -exec sed -i 's/\(\)/_/' {} \;

But this only seems to do a search and not actually replace the filenames.
Would anyone be able to give me the proper command?
I suck at regex.. B-)
 

2 comments

Status
Not open for further replies.

About the author

A
Active Member · Joined
326
Messages
4
Reactions
18
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom