Questions tagged [rename]

The rename tag refers to the action of giving a different name to either an existing file or to a copy of a file as part of some other operations (.e.g. remote copy, backup). Use this tag as well for questions related to the (perl) rename command.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

Rename bluetooth device in GNOME

I use blueman to rename a paired bluetooth device (let's say, a headset). Is there a way to make GNOME show the same alias instead of the original name?
0
votes
2answers
42 views

Append string at end of every filename

Not sure what I'm doing wrong - I want to add "_Test" at the end of every file name in my current directory. Version gives me rename from util-linux 2.23.2, I've tried rename $ _Test * and ...
0
votes
3answers
56 views

How to increase variable value in rename command

I want to rename files as increasing number format like this: 04.jpg 05.jpg 06.jpg Therefore I need to file a way to increase variable value and pass it to rename. Somehow the internet told me to do ...
0
votes
2answers
25 views

Batch rename folders appending fixed text and moving part of the name

I have several directories named in the pattern [year] name, like [1900] aaaa, [1901] bbbb, [1902] cccc, and so on. I'd like to append a fixed text - to the beginning of the name and move the [year] ...
0
votes
1answer
15 views

(perl) Rename bulk files - moving section starting with #{NUMBER} to front

I am trying to rename many files with the example formatting using rename with perl scripting 'Balisong Tutorial - (0g Chaplin) - Advanced #21-d8ajkHL34s0.mkv' 'Balisong Tutorial - (ALT Reverse Behind ...
0
votes
1answer
32 views

Using mmv, how do you replace every x with y?

So my filename looks like this : Building+a+Container+for+Robust+Conversations.pdf I would like to use mmv to rename it like this : Building_a_Container_for_Robust_Conversations.pdf Or like this : ...
0
votes
1answer
17 views

Change the position of a word in directory name

I have several hundred directories currently in this form : Band Name - Album Name (year) I would like to rename everything (with a mass treatment) in Band Name (Year) Album Name Almost all of my ...
1
vote
4answers
45 views

How to rename dates in multiple file names

I have files that look like this: ABC_20210101.csv ABC_20210101_imp.csv I would like to update the dates in the file name to a specific date: ABC_20201231.csv ABC_20201231_imp.csv How can I go about ...
0
votes
2answers
26 views

Cannot rename directory in the root directory

My HDD is divided into two partitions and they are placed in the mnt folder under the root directory. And they are located inside new and windows respectively. Whenever I attempt to rename the second ...
0
votes
1answer
38 views

Moving group of files to another directory using the command “rename” with regular expressions

I have some markdown files that I want to move to a different directory called "newDirectory2" within "newDirectory1". These files contain the string "abc" or "ABC&...
0
votes
0answers
18 views

Syncing renamed files without copying

I've renamed a bunch of files and moved some to other folders. Now I want to sync all these changes to another filesystem, that already contains the original files. Something like rsync with --delete. ...
1
vote
2answers
36 views

How to rename a file to its creation date and hash value combined in order to achieve unique filename?

I have bunch of .JPG, .NEF and .MOV files made with my Nikon DSLR, named as DSC_0001.JPG, DSC_0002.JPG and so on. After certain number is reached, new directory is made and number count restarted, ...
4
votes
1answer
93 views

perl `rename` script not working in some cases?

I tried running the following command: find . -type f -exec rename -v 's/ /_/g' {} \; , to rename all files recursively with spaces in their names with underscores. The problem is that it works ...
0
votes
1answer
54 views

How to rename a batch file

I want to rename a file from Chat WhatsApp dengan A3 - 21.mp4 Mine.mp4 MoviMax_MV1_V016_2.106.001_20150227_2030_fbf.mp4 bedrock_server.mp4 to test1.mp4 test2.mp4 test3.mp4 test4.mp4 How can I do it?
0
votes
2answers
36 views

Bulk file rename

I have a large collection of files with filenames similar to: myvideo.s01e01.episode.title.here.mp4 myvideo.s01e02.episode.title.here.mp4 I'd like to bulk rename them so I end up with: myvideo.s01e01....
0
votes
1answer
35 views

Rename Files in Directory Appending Three Digit Numbers and Spaces and Varying Extensions via Terminal

I have a list of files in a directory that display like this via an ls command: 01-Campout 2001.jpg 2-Campout 2001.png Campout 2001 - 3 of 21.tiff Campout 2001 - 4.pdf I would like to know what bash ...
0
votes
1answer
80 views

Copy and rename files recursively using part of folder name for new name

I'm trying to recursively copy a folder of files containing .csv extensions and rename them while copying them into a single folder. I'm close except for the file renaming which eludes me. Can anyone ...
1
vote
1answer
86 views

Bash - Archive Name to File Name, Improper Matching (zip,cdg,mp3)

I have written a script that checks for two particular extensions in a zip archive. A couple checks are made that determine if the archive has only 2 files then it process them. If the archive has ...
1
vote
1answer
27 views

Passing argument of a function to exec in find

I would like to define a function to find and replace text in multiple files. I find the command line find . -type f -exec bash -c 'mv "$1" "${1/<string_to_find>/<...
0
votes
1answer
39 views

Rename files in any deep subfolder like the parent folder and move after to a central folder

I have a problem where I need to rename just certain files after the parent folder and afterwards move these to a central folder. Is there a way to do this? I would like to run this on a Synology NAS. ...
0
votes
1answer
49 views

How can I rename files within dir(s) to their respective dir name while maintaining extensions of files?

I have a bunch of directories with different names within the current directory: Hello World/ Dr. Dre - Still Dre/ Angry Birds/ 2018 Grand Prix Race Highlights/ And within each of those directories ...
1
vote
1answer
17 views

Rename all directories reversing date string name delimited by hyphens

I have subdirectories named as dates like 09 January 2020. I renamed all the directories to replace spaces with hyphens using the terminal command: $ for i in *; do mv "$i" "`echo $i | ...
0
votes
2answers
129 views

Rename special characters in filenames to underscore

I am trying to change all characters that are not letters, numbers, dashes, dots, or underscores to an underscore in file names in a directory. So far I have the following: ls *.mp3 | sed 's/[^0-9a-zA-...
0
votes
1answer
27 views

User of "rename -p/--mkpath--make-dirs

I try to understand the syntax of the rename command option switch "-p/--mkpath--make-dirs". I am searching now the web for some time, but this option does not seem to be very common. I ...
0
votes
2answers
64 views

Renaming files using part of the path name

I need to rename all logs using part of the directory name. The logs appear like so: friday13/stack123/FooBar-QA-123/000001.gz friday13/stack123/FooBar-QA-123/000002.gz friday13/stack123/FooBar-QA-123/...
-2
votes
2answers
53 views

Append suffix to all files with a certain extension

Write the command that will locate all files that have the suffix/extension of .py. For each file that is located, the command should append the suffix/extension of .backup to the file. So, if a file ...
0
votes
1answer
67 views

Rename Subdirectories Recursively

I am trying to rename the following directory structure Tests Directory ├── Test1 Directory │ ├── 2 - 1. Data │ ├── 3 - 2. Data │ ├── 4 - 3. Data │ ├── 5 - 4. Data │ ├── 6 - 5. Data ├── ...
0
votes
4answers
65 views

Rename specific files

I am in need to rename files in a directory, for example from 11-Vnnn_S2_L001_aaa_bbb_ccc_ddd.ext to Vnnn.ext Is there a way to do that with basename command in Linux? I am very new to coding, so I ...
0
votes
0answers
23 views

Renaming files based on the contents of a text file outside

I have a file which contains the filenames and the rename detail. When i am using this script from the folder its running fine, but when I am trying to run it from outside I am getting error. mv ...
2
votes
4answers
347 views

select and move unique files based on some pattern

I have a list of files on a Linux machine which are differ by some date, so I have to search for unique files and need to place them in some other directory. "Unique" here refers to the name ...
1
vote
3answers
75 views

I need to rename folders, the new names are in txt files inside each folder

I would need some help. I have a bunch of folders, with non-descriptive names. Inside each folder, there is a "info.txt" file with several lines, but I'm interested in two of them: artist = ...
0
votes
3answers
50 views

pattern substitution of file name

I have to create again my question, since all of the found sollution did not work for my case. Dealing with many filles I would like to use some one line utility, which allows to make several ...
0
votes
1answer
91 views

Rename multiple files according using a names-list

I'm trying to rename multiple numbered files according to a list of names. Example: 1.pdf, 2.pdf, …, n.pdf And a file called names.txt, with a value per line: Fabio Joao n-name So we will have 1....
0
votes
1answer
63 views

Rename files from .txt list

I've got .txt list with files and corresponding MD5 hash: ab16d9ab5682bb0038c901ad8fc424c0 *file1.doc 28bb8e092301340f19585201166e5b86 *file2.doc 5f53d5e9512a717049185fcf617b8a37 *file3.doc ...
2
votes
2answers
68 views

How to recover from replacing all characters in my filenames 1:1 with whitespaces?

$ rename 's/./ /g' * $ ls -l total 6832616 -rw-r--r-- 1 jboo jboo 0 Sep 28 01:44 -rw-r--r-- 1 jboo jboo 43361681 Sep 28 01:44 -rw-r--r-- 1 jboo jboo 47499946 Sep 28 01:44 -rw-r--r-- 1 jboo ...
0
votes
1answer
31 views

Rename files into sub directories

I'm attempting to rename a bunch of files with 'rename' and I have my regex nicely setup: rename --verbose --path 's|^\[(....)\](.*)\.(.*)|$2 ($1).$3|' * But I'd really like to have each file put into ...
0
votes
0answers
285 views

Can't rename the directories getting error: Invalid cross-device link

How to replace %002E with a dot(.) from all the directories and sub-directories name. I tried the below command but it's not working find . | rename -v "s/%002E/./g" getting this error when ...
2
votes
2answers
147 views

How to rename files removing everything up to the second or third occurence of a character?

I have a list of files, in different folders, named like aaaaaa_bb_cccc_ddddd_ee.jpg In some of them, I need to remove everything up to the second _, so they become cccc_ddddd_ee.jpg In others (...
0
votes
1answer
62 views

Recursively renaming folders to @eaDir

I'm trying to use a thumbnail generator python script I found on GitHub, which works awesomely. It generates thumbnails in a folder called eaDir_temp, which then needs to be renamed on the NAS to @...
3
votes
2answers
162 views

How might one except hidden '.' files and directories from a script that renames them?

I have a script that renames, getting rid off the whitespace, every directory and file. It does it recursively: #!/bin/bash find -name "* *" -print0 | sort -rz | \ while read -d $'\0' f; ...
0
votes
0answers
13 views

What is the *nix terminal command similar to Krename's command for renaming the fonts with fontFamily fontStyle?

I am seeking for a pure terminal command for Arch Linux's PKGBUILD to rename fonts with [fontFamily] [fontStyle], similar to KDE's Krename:
3
votes
1answer
68 views

Renaming files with non-ASCII files to append their own datetime in ASCII

Multilingual environment and our file storage on linux of course allows all those international (Asian) characters in filenames. But this is causing problems syncing to other systems because the ...
2
votes
1answer
36 views

Rename all files with specific format which are in folder with specific name

In my project I have a lot of test files, which are named *.ts. They are all in __tests__ folders, but it can be __tests__/test1.ts, __tests__/dir2/test2.ts and so on. I would like to rename those ...
2
votes
1answer
77 views

rename directories containing left/right square

To rename directories containing left & right squares you can use: shopt -s globstar rename -n 's/\(|\[|\]|\)//g' ** This will rename everything with [ & ] from the directory you're in and ...
0
votes
0answers
43 views

Bash: remove spaces in directory name [duplicate]

!! This question is not about SHELL, it's about BASH, can't change the faulty tag !! I've got a code that removes the spaces in directories and filenames (and inserts a dot); find $jdir -depth -name &...
0
votes
1answer
64 views

How to change end of filename

I am using Mac Terminal and I need to delete end of filename. Example of filename : 1516092009.M432844P7000.camel5,S=14022,W=14295/2, I need to delete the end /2, and I tried command: rename 's/\/2,//...
0
votes
1answer
20 views

swap fields in file names

How can I do the following change in file names. I suppose this is possible with rename, but I do not know how. A_B_C.pdf to C_A_B.pdf A, B and C are different words in my file names, like ...
-3
votes
1answer
66 views

Remove beginning and ending of file names in shell

I want to rename my phone screenshot with the name: Screenshot_2020-08-06-16-13-43-731_com.tclhz.gallery.jpg to 2020-08-06.jpg Regarding the fixed parts of the file name, I want to generalize it so I ...
0
votes
2answers
27 views

Rename some files with particular format

I would like to rename some files. I have a lot of files with this format: ?????.pdb. The name of this file is composed of 5 characters (numbers and letters) and the new name will be like this ????...
0
votes
1answer
45 views

How do I remove any and all characters before the first period in a file name?

I have 1366 files whose file names start with up to four numbers. For example: 128.unique filename.flac 6.unique filename.flac 1288.unique filename.flac I want to remove all numbers and the period, ...

1
2 3 4 5
21