All Questions
Tagged with rename shell-script
181 questions
3
votes
3
answers
87
views
Rename batch of pictures with a very specific format
I have about 4k pictures with this format:
photo_6923@06-01-2022_14-18-36.jpg
photo_6924@07-01-2022_00-03-23.jpg
photo_6925@07-01-2022_01-36-20.jpg
photo_6926@07-01-2022_10-44-20.jpg
photo_6927@07-01-...
2
votes
6
answers
655
views
Convert EPOCH string in filename to readable format
My knowledge of Unix is not very good.
I'm trying to write a shell script to rename a set of files in a directory, like 1709532255.mp4 to 20240304_070415.mp4, where 1709532255 is always an epoch time.
...
0
votes
1
answer
89
views
Need help with a script that mv (renames) filenames that require single quotes in ls output or file operations
I need help with a script that mv (renames) filenames that are shown with single quotes in ls output or files that require single quotes for file operations. The script will be used to rename all ...
0
votes
1
answer
160
views
Renaming batch files for PLEX
I am attempting to rename a batch of .mkv files from the original format to the preferred PLEX format. I am having difficulty with sed and with rename and with mv. I hope it is just a syntax error I ...
0
votes
2
answers
83
views
The loop for file renaming doesn't work right
There are 32 *.dds files in a folder:
pic-0.dds, pic-1.dds, pic-2.dds,...,pic-31.dds
I'd like to rename them to be:
015040.dds, 015041.dds, 015042.dds,...,0150471.dds.
I'm trying to use the ...
-2
votes
1
answer
272
views
Need to batch rename files with names from text file using core utils
So I am a bit of a noob and have a problem at work. There is a program outputs names in a ie
apple
banana
orange
P1n34ppl3
The problem is that the files that correspond to that (separate program) are ...
4
votes
1
answer
1k
views
Replace all periods with hyphens recursively
To replace all spaces with hyphens, in all files/folders, in all sub-directories, I run the following:
find /path/to/folder -depth -name "* *" -execdir rename 's/ /-/g' "{}" \;
...
-1
votes
1
answer
126
views
Rename numbered files based on a list of corresponding names [closed]
I want to rename my files using a .txt file with proper names
These are my files:
lesson1.mp4
lesson2.mp4
lesson3.mp4
...
This is my txt file with names:
1 Entry to vim
2 Basics of vim
3 Vim motion
.....
1
vote
1
answer
68
views
Rename filenames in different folders
I have a bunch of directories like the following with multiple files in each of them
.
├── 20150320
├── 20150321
├── 20150322
├── 20150323
├── 20150324
├── 20150325
...
Then I've put together ...
0
votes
1
answer
283
views
Bash Script to Recursively Rename Files without changing file extension
I am attempting to rename all files (.jpg,.jpeg,.mov,etc) in parent directory and all subdirectories to date_time_7digitnumber without changing the file extension. The below script accomplishes this ...
1
vote
2
answers
374
views
Rename files with numbers already in file name
I have files with following names starting with water-frames0.gro upto water-frames201.gro
water-frames0.gro water-frames119.gro water-frames138.gro water-frames157.gro
water-frames116.gro water-...
2
votes
4
answers
1k
views
Rename a bunch of file by replacing a number in the filename by a coresponding string from a textfile
I have a large number of files I want to rename. Each filename contains a number (xxx): FIXED_PART_xxx_UNIQUE_PART.
I also have a text file, which has a number and a string in each line:
001 string001
...
0
votes
1
answer
370
views
Rename Files within multiple directories based on partial directory names
I have many directories in a location with files of various extensions within them. The directories follow a standard convention but the files within do not. The solution I'm trying to come to is to ...
0
votes
1
answer
1k
views
Renaming all files in a certain directory and sub directory on MacOS?
I'm trying out the code that answers this questions:
How do I change the extension of multiple files?
I tried this:
# Rename all *.js to *.ts
for f in *.js; do
mv -- "$f" "${f%.js}....
2
votes
1
answer
2k
views
Rename multiple files in multiple subdirectories using for loop
I am trying to rename files with the same names in different subdirectories using for loop.They should be renamed according to the name of subdirectory.
Subdirectory1/File.txt
Subdirectory2/File.txt
...