Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

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
3answers
91 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 ...
1
vote
3answers
88 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 /...
0
votes
3answers
240 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 ...
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
2answers
40 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
2answers
104 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
2answers
645 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
2answers
214 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
626 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, ...
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
2answers
81 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
2answers
131 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
2answers
167 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 ...
-2
votes
2answers
118 views

how to remove all characters after and including “?” in filename?

I have a large amount of files that were downloaded and ended up having what looks like authentication parameters added to the filename which I would like to remove. Examples: file1.doc?...
2
votes
1answer
152 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 ...
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
1answer
979 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 ...
1
vote
1answer
483 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
1answer
799 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
1answer
600 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
1answer
995 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
1answer
25 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
1answer
35 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
1answer
70 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
1answer
170 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
1answer
161 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
527 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
711 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 ...
0
votes
1answer
499 views

defining rename command scope; replace word; replace entire file name; wildcards

Im looking to use the rename command to edit file names. More specifically, Im trying to isolate specific pieces to change, or in some cases, the whole name. For example: Lets say I have three ...
-1
votes
1answer
25 views

Rename a directory and subdirectory inside a directory having same name

I have a directory called Dual_Loop_PLL. Inside that I have 2 subdirectories: agent and test. Inside agent I have a directory called dl_pll_agent, and inside dl_pll_agent I have dl_pll_agent2. I want ...
-1
votes
1answer
38 views

renaming txt files

I have a list of files named like this SLX-11025.N701_N504.C8912ANXX.txt And need to rename them based on this small part N701_N504, and each will be renamed to an specific code (for example - ...
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 ...
2
votes
0answers
374 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
376 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
0answers
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 ...
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 ...
1
vote
0answers
522 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
0answers
308 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
55 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
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
0answers
538 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
0answers
369 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 ...
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
0answers
24 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
0answers
74 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
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 ...