• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How To Rename Multiple Files In Linux Ubuntu With Single Command

How To Rename Multiple Files In Linux Ubuntu With Single Command

By Sourabh / July 10, 2017 Category: How To, Ubuntu

How To Rename Multiple Files In Unix With Single Command. Learn about rename command in Linux that can rename multiple files. Users can rename multiple files in Linux using wildcards, using rename command.

rename

renames command is a wonderful command to rename multiple files at once using commandline/terminal. “rename” renames the filenames supplied according to the rule specified as the first argument. The perlexpr argument is a Perl expression which is expected to modify the $_ string in Perl for at least some of the filenames specified. If a given filename is not modified by the expression, it will not be renamed. If no filenames are given on the command line, filenames will be read via standard input.

Command Syntax

rename [ -h|-m|-V ] [ -v ] [ -n ] [ -f ] [ -e|-E perlexpr]*|perlexpr [ files ]

Command Usage

rename-ubuntu

For example, to rename all files matching “*.jpg” to png, we will use the rename command as rename ‘s/\.jpg$/\.png/’ *.jpg You can also use the command to translate uppercase names to lower, you’d use rename ‘y/A-Z/a-z/’ *

Let us see how to use rename command to rename all jpg files to png. You can see in the screenshot above that we have only one png file named krusader.jpg. We will use rename command to change this file to png. To do so, run the command:

rename 's/\.jpg$/\.png/' *.jpg

Now let use learn a bit about the command. The rename command has two parts. The first command argument is a perl expression that tells the system to rename the file with .jp extension to .png extension. The second command argument directs the system to rename all the files with *.jpg extension. In simple words, the first commands describes what to do and the second one tells that the same operation will be executed on all files with the specified extension.

Please note that the rename command is part of the util-linux package. You may have to install it on Ubuntu Linux Systems. To install, run the the following command:

sudo apt-get install renameutils

Command Options

The rename command has many options:

  • -v, -verbose
    Verbose: print names of files successfully renamed.
  • -n, -nono
    No action: print names of files to be renamed, but don’t rename.
    -f, -force
    Over write: allow existing files to be over-written.
  • -h, -help
    Help: print SYNOPSIS and OPTIONS.
  • -m, -man
    Manual: print manual page.
  • -V, -version
    Version: show version number.
  • -e
    Expression: code to act on files name. May be repeated to build up code (like “perl -e”). If no -e, the first argument is used as code.
  • -E
    Statement: code to act on files name, as -e but terminated by ‘;’.

Tags: Dos Command Rename Multiple Files, Dos Rename Wildcard, How To Rename Multiple Files At Once In Linux, How To Rename Multiple Files In Unix With Single Command, Linux Command To Copy A File, Linux Rename Examples, Linux Rename Files Pattern, Linux Rename Multiple Files, Linux Rename Multiple Files Extension, Linux Rename Multiple Files Regex, Linux Rename Regex, Ren Command In Batch File, Rename Command In Sql, Rename Command Linux, Rename Command Mac, Rename Command Unix, Rename Directory Command In Unix, Rename File Command Line Mac, Rename Folder Command In Linux, Rename Multiple Files In Linux Using Wildcards, Rename Multiple Files Unix, Unix Command To Rename Multiple Files In A Directory, Unix Rename Command, Unix Rename Multiple Files, Unix Rename Multiple Files Extension, Unix Rename Multiple Files Pattern, Unix Rename Multiple Files Wildcard

Primary Sidebar

Latest Posts

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To Check Kernel Installed Date In Linux Ubuntu

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

How To Fix Initramfs Error In Ubuntu Command Line

How To Check All Available Kernel Version In Linux Ubuntu

3 Best Artificial Intelligence Domain Name Generators

© 2025 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap