Command for rename file as IMG0001 to 4R0001 in folder  for f in *;do mv "$f" `echo "$f" | sed 's/IMG/4R/g' `; done   AND   I just want rename selected folder  /tmp/2014/1201 (rename files) /tmp/2014/1202 ....... /tmp/2014/1220 /tmp/2014/1224 (rename files) /tmp/2014/1227  .......   find not good for selected folder  awk for selected folder by renamelist.txt but miss match with for loop $value  Thanks
21155
I have the below list of files  aro_tty-mIF-45875564pmo_opt aro_tty-mIF-45875664pmo_opt aro_tty-mIF-45875964pmo_opt aro_tty-mIF-45875514pmo_opt aro_tty-mIF-45875524pmo_opt   that I need to rename to  aro_tty-mImpFRA-45875564pmo_opt aro_tty-mImpFRA-45875664pmo_opt aro_tty-mImpFRA-45875964pmo_opt aro_tty-mImpFRA-45875514pmo_opt aro_tty-mImpFRA-45875524pmo_opt
91376
Is this possible? I read somewhere that the following command would do it:     sed -e [command] [file]   but it appeared to do the same thing as just     sed [command] [file]   (it did not save the changes). Is there any way to do this using sed?
25014
How can I recursively replace a string in all folders and files' name with a different string? I am running Red Hat 6 and I can find them with:  find . -name \*string\*   I've managed to do it for strings within files:  find . -type f -exec sed -i 's/string1/string2/g' {} +   but how could I replace in a similar way all file names?
35201
I have files in the following format: x1 x2 ... x10 x11 ... x101 ...  I want to rename these files, so they all have the same name length: x001 x002 ... x010 ...  I can do this with files, that don't have the non-numeric prefix (just using sort -n followed by a while read x;), but sort doesn't recognize the numeric value, when it's not on the beginning of the file-name.
98344
I find myself frequently needing to rename different files with mv that are in deep directories:  mv /a/long/path/to/a/file.txt /a/long/path/to/a/file.txt.bak   But I don't want to retype the full path name. Is there a quick shorthand or alias that I could use? I.e.:  $ mv /a/long/path/to/a/file.txt file.txt.bak $ ls /a/long/path/to/a/file.txt.bak a/long/path/to/a/file.txt.bak   (note: this is for straightforward, single file renames in different directories at different times, not for )
25249
I realized I had named a bunch of files in an off-by-one fashion so I wanted to rename any file starting with "1" to the same thing except starting with 2.  For example mv 1.4.5.txt 2.4.5.txt or mv 1-chart.jpg 2-chart.jpg etc.  I tried mv 1* 2* but this was not accepted because it interprets 2* as a directory.
101132
I've multiple files located in /opt/rec/ which I want to rename only some part of it using bash.  Original file name:  WK6LZTPR99999999_dig_2017-07-10 01:55:57.xy   which I want to change all files with in that directory as:  WK6LZTPR99999999_cur_2017-07-10 01:55:57.mp3
89541
I would like to rename all files in a folder so to have consecutive numbers. For instance:  1.png 2.png 3.png etc   I know there is the rename command and I know there are DOZENS of similar questions in here but I can't find the way.  NOTE: Suggested duplicate doesn't contain a solution specific for my case. Please stop flagging this as duplicate, because suggested duplicate does not answer my question
60881
I want to rename file name with its parent folder name, adding the folder name before the current name.  for example:  Folder structure  SOCH NC KT 633-ROYAL BLUE-MULTI | | 1.jpg | | 2.jpg | | 3.jpg   Expected Result  SOCH NC KT 633-ROYAL BLUE-MULTI | |_SOCH NC KT 633-ROYAL BLUE-MULTI1.jpg | |_SOCH NC KT 633-ROYAL BLUE-MULTI2.jpg | |_SOCH NC KT 633-ROYAL BLUE-MULTI3.jpg  SOCH NC KT 710-BLACK-MULTI   Could anyone advise how this can be done in a .sh file? Is there any utility is available to do the operation?
104283
I have some files named like these:  63018933.mp4?token=1325697436_b0c3e70c6e339380b4a484c576a8c287  63808488.mp4?token=1325697401_4ae5f7a68d93873c8881b303e7655e14  How do I rename all them to, for example 63018933.mp4(remove characters after mp4)?
66636
I would normally open the parent folder and search for * in order to select all of the files in subfolders, but in this instance, I have over 1,000,000 files that I need to sort through, so my explorer often crashes when trying to copy that many files through the GUI. I am not sure how much more effective this will be through the command prompt or a batch file, but it is worth a try, I suppose.  What I need to do is make it so that  |parent |    |123 |    |    123abc.png |    |456 |    |    456def.png |    |789 |    |    789ghi.png   becomes  |parent |    123abc.png |    456def.png |    789ghi.png   Yes, my actual file structure has the first 3 characters of the file name given to the folder name, if that can help at all in sorting these.
104986
I'm trying to run  sed -i "/$variable/c \$variable1' file.txt   But it's not displaying any change in the file: file.txt.  But the same command, with out the variables works fine:  sed -i "/variable/c \variable1' file.txt
55257
I have the following files   SSt12.precip.374.sub.climatology.ctl SSt12.precip.2874.sub.climatology.ctl SSt12.precip.3764.sub.climatology.ctl SSt12.precip.6774.sub.climatology.ctl   I want to rename the files as   SSt12.precip.1.sub.climatology.ctl SSt12.precip.2.sub.climatology.ctl SSt12.precip.3.sub.climatology.ctl SSt12.precip.4.sub.climatology.ctl
94139
I found an answer for  which works fine for renaming filenames as follows :  1.jpg &gt; 00001.jpg 2.jpg &gt; 00002.jpg . . . 9.jpg &gt; 00009.jpg   That uses the following command:  rename 's/\d+/sprintf("%05d", $&amp;)/e' *.jpg   But my filenames aren't numeric. They are an alphanumeric sequence, like: a.jpg, b.jpg, c.jpg...... m.jpg.  In a similar way to the original question, I want to rename these so they display in the correct sequence. How do I do this?
106085
I want to rename my file to the current timestamp.I know how to get the current timestamp("date +%s") but how can I pipe it to 'mv' command?
79640
What I want to do: I have a folder with a great bunch of images. Using these files I want to create a slideshow video, while I want the filename of each of the original images burned into the bottom right corner.  What my current state is: I made a script to fetch all .jpg files in the folder and make a ffmpeg-readable list and I know how to concat the images to a slideshow and everything works as intended. I also figured out how to use FFmpeg's drawtext to get a handsome filename stamp.   Now the problem: Currently FFmpeg grabs the last filename from the file list (for example IMG_9935.jpg) and burns it into the entire video. But what I want to happen is, that it changes with each 'new' image - just like a timecode would change during the course of the video.  Is any of this possible?  As a side note: "Why don't you burn the filename beforehand?" I'd like to keep it as flexible as possible. So if there's another way round, I'd like to go that way.  for i in *.jpg; do echo "file '$i'" &gt;&gt; files.txt; done  ffmpeg -r 1/3 -f concat -safe 0 -i files.txt -vf "eq=text=$(echo $i | rev | cut -d / -f 1 | rev): fontcolor=0x808080: fontsize=14: x=w-tw- 10:y=h-th-10" -c libx264 filename.mp4
104899
I have a file that contains filenames with absolute path.  In the middle of that path, is a variable directory, whenever I hard code the variable part, it works fine, but when I replace it with the variable name, the sed part doesn't work.  The sed part is to delete the pattern or for this matter, the path.   file=`echo $one_file | sed 's:/dir1/dir2/$VAR/last_dir/::'`