Welcome to the Linux Foundation Forum!

How to recursively merge directories or folders into one, retaining folder names in file names on li

Basically, I have a directory tree. I want to find and replace all "/" within that tree with "-".

can i use mv or find?

I want a directory tree to become one directory with lot of files with long names which include the names of the sub-directories which they used to be in.

for example these paths

/a/file.ex
/a/b/file.ex
/a/b/file2.ex
/a/c/file.ex
/a/c/d/file.ex
/a/c/d/file2.ex

will become files:

/a/file.ex
/a/b-file.ex
/a/b-file2.ex
/a/c-file.ex
/a/c-d-file.ex
/a/c-d-file2.ex

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training