Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 5
    This did not work on my machine (Arch Linux), but mik's answer did. Commented Apr 21, 2017 at 8:14
  • 9
    There are two common rename utilities but neither of them are developed by GNU: Debian-based distributions include a rename utility with their Perl package while Red Hat-based distributions use the rename utility from the util-linux from the Linux Kernel Organization. Your link is to the rename C function from the GNU standard library. Commented Jul 7, 2017 at 9:16
  • 4
    In this answer, why do we have to write /g in rename 's/#U00a9/safe/g' * Commented Jul 9, 2018 at 21:25
  • 1
    waiting for the reason for /g as @Nikhil pointed Commented Nov 5, 2019 at 18:24
  • 4
    /g means global search, i.e. once it finds and replaces an instance of the string, it will keep searching the filename for more instances. So foo_foo.jpg would become bar_bar.jpg. If you didn't put the g, foo_foo.jpg would become bar_foo.jpg instead (only the first instance of 'foo' would change) Commented Feb 26, 2020 at 15:31