Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
When trying to run the rename command on a file tree using find, I'm not getting any output from the rename command itself. The command does it's job, but nothing is output to stdout.
Let's say I run this:
find . -exec rename "s/[\']//g" '{}' \;
which removes any and all apostrophes from the filenames. It works, but there's no output from rename to tell me which files it actually changed. Needless to say, this is rather annoying. On the other hand, I can do this:
find . | rename "s/[\']//g"
Which does show me the output. But then I run across a different problem. If the rename function changes the name of a folder first, then any files nested under that folder fail to get changed. I then have to run the command a second time.
This is the first time I've tried to use the -exec option of find. Is this its regular behavior? Is there any way to force find to show me the output of the executed command?
I completely forgot that I had aliased 'rename' to 'rename -v' a while back, so I mistakenly thought that the verbose output was the standard behavior. It figures I'd make myself look stupid asking this question.
I'm not sure I follow you syg00. The rename utility I'm using is one of the basic perl tools, and should be available just about anywhere perl is installed ('rename' is actually a link to 'prename'). If other distros or installations use something different I'm sure I'd discover it fairly quickly and learn to adapt. Besides, I only use Debian on my home systems, so it's not like I'm going to run into trouble anytime soon.
My problem here was just forgetfulness and a stupid assumption on my part.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.