Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a --depth option #1356

Open
muellerj opened this issue Aug 1, 2023 · 0 comments
Open

Include a --depth option #1356

muellerj opened this issue Aug 1, 2023 · 0 comments

Comments

@muellerj
Copy link

muellerj commented Aug 1, 2023

First of all thanks for a great tool!

For renaming nested files/folders, find(1) has a -depth option which traverses the file-system in a depth-first order in order to avoid trying to rename an item in an already renamed folder:

# Rename all files and folders containing "_foo" by replacing "_foo" -> "_bar"
find . -iname _foo -depth -exec rename _foo _bar '{}' \;

Any chance of having a similar option for fd?

See: https://man7.org/linux/man-pages/man1/find.1.html#EXPRESSION

I've seen that there has been some discussion about breadth first/depth first traversal already - thank you for your consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant