Bulk Rename Files in Linux: Complete Guide

In Linux, you can batch modify file names using the following methods:

  1. move
  2. Can you move this?
  3. Could you please send me that document as a .txt file?
  4. .bak file extension
$ for file in *.txt; do mv "$file" "${file%.txt}.bak"; done
  1. change the name of
  2. change the name
$ rename 's/ /_/g' *
  1. sed is a command-line text editor used to perform various tasks such as finding and replacing text, inserting text, deleting lines, and more.
  2. transform
  3. Please provide the document in a .txt format.
  4. elderly
  5. fresh
$ for file in *.txt; do mv "$file" "$(echo $file | sed 's/old/new/')"; done

These methods can assist you in bulk modifying file names. Before you proceed, it is recommended to backup your data to prevent accidentally losing files.

bannerAds