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.

54 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
3answers
1k views

Recursive copy files with rename

If I have input folder files_input that has subfilders like 01-2015, 02-2015, 03-2015 etc and all these subfolders have other subfolders. Each subfolder has only one file called index.html. How can ...
3
votes
1answer
4k views

rsync + renaming the copied files

Is it possible to change the name of the destination file (add some timestamp as a prefix) when copy is done by rsync ? For example, I can use the following command to change the name of the ...
3
votes
0answers
1k views

How to rename file and folder of mp3 based on ID3 tag

How to rename music files based on ID3 tag with format: number. title where the number doesn't exists on the id3tag but exists on the file name? And how to rename folders based on ID3 tag with format ...
3
votes
3answers
92 views

Can I forbid the creation of files with certain permissions?

I have a directory with a certain group ID, and I only want files with the same ID to be in that directory. So I set the SGID bit on that directory, so that everytime a file is created inside it, it ...
2
votes
0answers
386 views

udev iw add interface rename issue

I need to put wifi interface into additional monitor state. If I don't use udev rule and wifi interface named by kernel as wlan0 (default): $ iw dev wlan0 interface add mon0 type monitor in this ...
2
votes
0answers
380 views

rename mov/mts files with exif data

I am trying to rename mov/mts files with their exif data. I have checked various ways with shotwell, gthumb, etc. Although gthumb does recognise the data, it will not rename (only jpg). I also looked ...
2
votes
4answers
1k views

Change part of the filename on multiple files in a directory:

I once had a script that would do the following. It would rename part of a filename of multiple files in the current directory: For example: rename variable1 variable2 rename 456 555 Input: ...
2
votes
1answer
151 views

Renaming the files and move to other path

I need to rename the files given below and move to some other path 1234551abcde20140718023216001.txt.809047512.2014_07_07_13:47:44 000001abcde20140718023216001.txt.34568.001.2014_07_07_13:50:44 ...
2
votes
0answers
123 views

Batch mv cronjob leaving some (not all) copies in source

I have a cronjob that runs every 5 minutes, looking for wavs and mp3s of the same name in a source directory and if it finds a corresponding pair, it moves both to a destination directory. The script ...
2
votes
1answer
987 views

Can I get the backup option of cp and mv to work with directories?

--backup[=CONTROL] make a backup of each existing destination file The man page does say that it works on file. It doesn't seem to have any effect on directories. Is there anyway to make this ...
2
votes
1answer
162 views

Move command to transfer all files in a subfolder to parent directory and rename if there are files with same name

So I have a directory that has 77 subfolders in it on my Ubuntu machine, each with various amounts of torrent files in them. Total of 427 torrents are contained in the subfolders. I want to move all ...
1
vote
2answers
56 views

Want to rename a files in folder with folder_1.txt folder_2.txt folder_n.txt name

I have 3 directories on my Ubuntu machine, named abc, xyz and pst. In each directory, I have approximately 7 files with different names. I want to rename each file like abc_1.txt, abc_2.txt, abc_3.txt,...
1
vote
0answers
560 views

Change visible OS Name

I have a Linux Mint 18.3 installation that I have heavily modified. I'm wanting to change the name of this installation so to a normal person, it isn't Linux Mint, but some other weird distro (cause ...
1
vote
2answers
41 views

Dropbox-Daemon crashes after renaming username

After I renamed my username in Linux Mint as described in this article, my Dropbox-Daemon allways crushes. Done renaming process: Ctrl+Alt+L Ctrl+Alt+T ~$ exec sudo -i ~$ killall -u oldname ~$ id ...
1
vote
3answers
89 views

How to change files with a specific word to end in.fasta

How do I select and change files that have a specific word in it to all end in ".fasta"? For example I'm selecting files with the word "car" in it. find /home/user -name "*car*" which gives me /...
1
vote
0answers
323 views

Adding a postfix when downloading files using CURL if a file by that name already exists

I'm downloading files from a POST endpoint using a command on the form while true; do curl -O -J http://domain/endpoint; done This endpoint "returns" a new file on each POST call. Curl gives each ...
1
vote
0answers
56 views

Convert multiple group of PNG files to multilayered ICO files

Let say I've many files named e.g.: FirstIcon_16.png FirstIcon_32.png FirstIcon_colored_16.png FirstIcon_colored_32.png SecondIcon_16.png SecondIcon_32.png SecondIcon_colored_16.png ...
1
vote
0answers
86 views

with rename GNU Linux

I have files in different folders. I want to rename specific files in each folder and its children matching a specific chain of characters: "". So after shopt -s globstar I tried the different ...
1
vote
1answer
484 views

Find and Replace of All Names

Background I am new to linux/unix (I'm on a mac. Don't know which I am using), but someone made a lot of folders and files under the wrong name, and I need to go in and replace everything with the ...
1
vote
0answers
53 views

Batch renaming files from nonzero start index

I'm merging two datasets, and they're in the format 40000X-????.mrc. However, they both start with 0000. Therefore, I want to start the second dataset after the end of the first (if the first dataset ...
1
vote
2answers
657 views

Rename all spaces in image file names inside html php files

Inside different htm.gz, html.gz and php.gz web files I have images and the ones in .jpg format have name with space instead of "-", but in /images/ directory where all images are located they have "-"...
1
vote
4answers
691 views

Bash script to fix file names

I have hundreds of folders with thousands subdirectories and files inside of them. The file names are currently in the format sf{number}-{number} - {text} and I need everything deleted until {text}....
1
vote
2answers
217 views

How to change the default use of detox, so it just doesn't replace spaces by underscores

I'm happy with the default usage of detox for sanitizing filenames, except I don't always want to replace whitespace with a single underscore. Would like to replace whitespace with a single space. ...
1
vote
2answers
636 views

How to copy and rename file listed in TXT file?

I need to copy all files listed in TXT file from one location to another location. /1132526906_tt_nad87_1.jpg /thumb/t1132526906_tt_nad87_1.jpg /1132526906_tt_nad87_10.jpg /thumb/...
1
vote
2answers
103 views

Make a Scheduled job for Renaming the files in a folder and send an updated alert email

I am writing a shell script, which can rename all the files in the folder, We need to search for a particular pattern of files every 30 seconds. Files in the below format need to be selected, ...
1
vote
1answer
804 views

File corruption using rsync, multiple rsync processes, moved/renamed source file

I'm encountering some file corruption when using rsync (that is, the file contents do not match the source file). I can understand the file becoming corrupt if it is being written to while being ...
1
vote
0answers
540 views

Automatically Rename File if there's a Duplicate Filename

I have a command that creates montages of images. Sometimes I want to save multiple montages from a series of images in a folder. The montage will be saved as output.jpg. But if I create another ...
1
vote
1answer
609 views

Two HDD partitions with the same name result in uncertain directories

I'm running Ubuntu 14.04 on a machine that has a lot of hard drives plugged into it. These hard drives have partitions with old OS's which have a lot of key data that I use often. The problem is, I ...
1
vote
0answers
373 views

Which Unixes support cross-device filesystem links (in particular for rename)?

Just read the following on the FreeBSD man page for the rename syscall: ... [EXDEV] The link named by to and the file named by from are on different logical devices (file systems). Note that ...
1
vote
2answers
114 views

MV Sub-Directories up one level but not to root

I have several folders in the following structure that I would like to sort. For example: /root/sub1/aaaa/bbbb/cccc/dddd /root/sub2/aaaa/bbbb/cccc/dddd /root/sub3/aaaa/bbbb/cccc/dddd /root/sub4/aaaa/...
1
vote
1answer
1k views

rename multiple files recursively and remove multiple characters such as ? : or newline from names

I have seen a few similar questions, but nothing that shows how to remove any of a set of special characters from all file names recursively. I want to keep uppercase and lowercase letters, numbers ...
0
votes
2answers
49 views

Get filenames and write them on place of previous namespace

I have hundreds of sources codes files. I want to rename namespace according to the filenames path. Of course slashes must be replace by dots. I have tried with find -exec but I failed to get the ...
0
votes
0answers
24 views

Renaming multiple files in specific order

I am looking to rename the 137 .jpg files from a directory with numbers from 1 to 137 keep the same order. The files look like this: IMG_20190512_164221.jpg IMG_20190512_171322.jpg ...
0
votes
1answer
26 views

Copy and rename files to a sequential numbering with subdirectories

I want to copy files of the given type with inside subdirectories. I think copy of the zzz.txt file works after copying the files in the abc_folder. How can i resolve this problem. AAA ---aaa.txt ...
0
votes
0answers
27 views

How to rename ISPConfig directories set by chattr command

I would to import a restore of a web directories to /var/www/clients/client4/web18/web managed by ISPConfig. I read ISPConfig put an attributes on this kind of directories. /var/www/clients/...
0
votes
1answer
36 views

Change file name while copying based on source path

I have a large number of files in directories of the format */*/*/*/*.txt and I would like to copy them into a different place while replacing the forward-slashes in the path with underscores. For ...
0
votes
2answers
84 views

want to Rename Images In Bulk in Linux

I have more than 1 million images with name of love-images-250x120.jpg 7788855441122-love-images-250x120.jpg us-wallpapers33344.jpg 77441144desktop-wallpapers.jpg desktop-wallpapers1144141411.jpg I ...
0
votes
1answer
79 views

Rename files in bash scripted based on file modified date

It has been awhile since I have had to drive into shell scripting. However, I have a shell script where I'm renaming files based on the file extension from a ftp upload. Currently, the files are ...
0
votes
3answers
245 views

Find and replace a string in a batch of files but do not create any filename conflicts

I have a directory tree with a few thousand files collected over the years with random and useless file names. I want to clean them up, keep them relevant, remove certain words but also not create ...
0
votes
2answers
144 views

Renaming a list of files from a text file

I have a folder containing these list of files. lesson1.mp4 lesson2.mp4 lesson3.mp4 lesson4.mp4 I`m trying to rename this files based on contents of "rename.txt" 1. Introduction to the React ...
0
votes
4answers
36 views

Find and unmark marked files using string compare?

In bash, I have a script that a uses while loop to copy files in a certain folder to various different directories. After each file is copied, I've written mv $dir/$file $dir/_$file using _ in the ...
0
votes
0answers
75 views

Old rename was better for me

Debian now has a new rename that is different from the old rename written in Perl. Is it possible to install, aside of new rename, the old one? Which steps should I perform to install the old rename? ...
0
votes
1answer
175 views

how to batch rename files in terminal - move text in file name from end of file name to front

I have recently started using wget to download files. I'm using ubuntu 16 mate to manipulate my files. I create custom urls to include specific information that I want saved to the downloaded file ...
0
votes
3answers
74 views

How to create a script or a command line that increment the variable part of the name of my files but some of them?

I have several files whose names aren't correct: $ ls devoirNote1_1_2.R devoirNote1_1_5.R devoirNote1_4_1.R devoirNote1_1_3.R devoirNote1_1.R devoirNote1.R devoirNote1_1_4.R devoirNote1_2_1.R ...
0
votes
2answers
178 views

Rename command - Key off of a digit or number

I have additional rename command question. I have files in the format: Gauge50.jpg Gauge51.jpg DigitalGauge_01.jpg DigitalGauge_02.jpg etc. What I want to do is target the Gauge50 and turn it into ...
0
votes
0answers
142 views

How to rename by a sequence in seq/nl/…?

Assume you have a list of files with random base names, some of of them have a order such as the following input example. I really would like to do this by nl/seq/..., not by some loop approaches as ...
0
votes
1answer
178 views

Sorting files by filename

I'm trying to sort my files by pattern into filename by creating Linux Script (Bash). My files are mostly .JPG, some .AV and .MP4. I can't use meta tags, because this files have broken tags (restored ...
0
votes
1answer
30 views

Why find is not finding some folders with spaces?

find -name "* *" -type d | rename 's/ /_/g' For instance, 'Paired End' folder name on this path is not being replaced with spaces: /home/bernardo/Raw_data/Raw_data_M6_and_V2_UIC_April_2014/...
0
votes
1answer
539 views

can mmv rename files by incrementing an index?

Can mmv, a mass move utility, nicely rename files from: foo.txt bar.txt baz.txt to: 1.txt 2.txt 3.txt The man page is intriguing, but I don't quite follow the directions: Rename all *....
0
votes
1answer
718 views

c shell script: find the directory and rename it

i am still new in this shell script. I have a task that given to me which i have difficulty to execute it. The task is i have a lot of directory which is based on ddmmyy. 03Mar2014 08Aug2013 ...