Change part of the filename on multiple files in a directory:
up vote
2
down vote
favorite
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:
testa456testa
sama456sama
apple456applea
johna_456_johna
davida_456_davidb
Output:
testa555testa
sama555sama
apple555applea
johna_555_johna
davida_555_davidb
I don't have the script anymore, and I am still new to Unix.
I need a script, that I can use from the command line.
What I do now is:
I list the files "ls * (file names)" to a temp file name. Then I do a search %/s/456/555/g. Then I move all old file names, to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory I would line to rename middle of file names from a command line. It could be hundreds of files. Hope this make sense, Thanks Ivan
rename
add a comment |
up vote
2
down vote
favorite
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:
testa456testa
sama456sama
apple456applea
johna_456_johna
davida_456_davidb
Output:
testa555testa
sama555sama
apple555applea
johna_555_johna
davida_555_davidb
I don't have the script anymore, and I am still new to Unix.
I need a script, that I can use from the command line.
What I do now is:
I list the files "ls * (file names)" to a temp file name. Then I do a search %/s/456/555/g. Then I move all old file names, to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory I would line to rename middle of file names from a command line. It could be hundreds of files. Hope this make sense, Thanks Ivan
rename
1
What's the question? Do you want help writing a script? Finding it? Making use of alternatives? Solving this specific problem of changing456to555? Please edit your text to include a question. And while you're there please tell us your UNIX flavour or Linux distribution.
– roaima
Oct 12 '16 at 21:17
yes, i need a script that i can used from the command line. I am still new to Unix. What i do is "ls * (file names)" to a temp file name. then do a search %/s/456/555/g. then move all old file names to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory i would line to rename middle of file names. It could be hundred of files. Hope this make sense, Thanks.
– ivan
Oct 13 '16 at 13:30
What UNIX flavour or Linux distribution are you using? Is there any particular reason why you haven't installed the missingrenamescript?
– roaima
Oct 16 '16 at 22:41
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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:
testa456testa
sama456sama
apple456applea
johna_456_johna
davida_456_davidb
Output:
testa555testa
sama555sama
apple555applea
johna_555_johna
davida_555_davidb
I don't have the script anymore, and I am still new to Unix.
I need a script, that I can use from the command line.
What I do now is:
I list the files "ls * (file names)" to a temp file name. Then I do a search %/s/456/555/g. Then I move all old file names, to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory I would line to rename middle of file names from a command line. It could be hundreds of files. Hope this make sense, Thanks Ivan
rename
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:
testa456testa
sama456sama
apple456applea
johna_456_johna
davida_456_davidb
Output:
testa555testa
sama555sama
apple555applea
johna_555_johna
davida_555_davidb
I don't have the script anymore, and I am still new to Unix.
I need a script, that I can use from the command line.
What I do now is:
I list the files "ls * (file names)" to a temp file name. Then I do a search %/s/456/555/g. Then I move all old file names, to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory I would line to rename middle of file names from a command line. It could be hundreds of files. Hope this make sense, Thanks Ivan
rename
rename
edited Nov 26 at 10:05
Michael Prokopec
72316
72316
asked Oct 12 '16 at 21:06
ivan
23125
23125
1
What's the question? Do you want help writing a script? Finding it? Making use of alternatives? Solving this specific problem of changing456to555? Please edit your text to include a question. And while you're there please tell us your UNIX flavour or Linux distribution.
– roaima
Oct 12 '16 at 21:17
yes, i need a script that i can used from the command line. I am still new to Unix. What i do is "ls * (file names)" to a temp file name. then do a search %/s/456/555/g. then move all old file names to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory i would line to rename middle of file names. It could be hundred of files. Hope this make sense, Thanks.
– ivan
Oct 13 '16 at 13:30
What UNIX flavour or Linux distribution are you using? Is there any particular reason why you haven't installed the missingrenamescript?
– roaima
Oct 16 '16 at 22:41
add a comment |
1
What's the question? Do you want help writing a script? Finding it? Making use of alternatives? Solving this specific problem of changing456to555? Please edit your text to include a question. And while you're there please tell us your UNIX flavour or Linux distribution.
– roaima
Oct 12 '16 at 21:17
yes, i need a script that i can used from the command line. I am still new to Unix. What i do is "ls * (file names)" to a temp file name. then do a search %/s/456/555/g. then move all old file names to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory i would line to rename middle of file names. It could be hundred of files. Hope this make sense, Thanks.
– ivan
Oct 13 '16 at 13:30
What UNIX flavour or Linux distribution are you using? Is there any particular reason why you haven't installed the missingrenamescript?
– roaima
Oct 16 '16 at 22:41
1
1
What's the question? Do you want help writing a script? Finding it? Making use of alternatives? Solving this specific problem of changing
456 to 555? Please edit your text to include a question. And while you're there please tell us your UNIX flavour or Linux distribution.– roaima
Oct 12 '16 at 21:17
What's the question? Do you want help writing a script? Finding it? Making use of alternatives? Solving this specific problem of changing
456 to 555? Please edit your text to include a question. And while you're there please tell us your UNIX flavour or Linux distribution.– roaima
Oct 12 '16 at 21:17
yes, i need a script that i can used from the command line. I am still new to Unix. What i do is "ls * (file names)" to a temp file name. then do a search %/s/456/555/g. then move all old file names to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory i would line to rename middle of file names. It could be hundred of files. Hope this make sense, Thanks.
– ivan
Oct 13 '16 at 13:30
yes, i need a script that i can used from the command line. I am still new to Unix. What i do is "ls * (file names)" to a temp file name. then do a search %/s/456/555/g. then move all old file names to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory i would line to rename middle of file names. It could be hundred of files. Hope this make sense, Thanks.
– ivan
Oct 13 '16 at 13:30
What UNIX flavour or Linux distribution are you using? Is there any particular reason why you haven't installed the missing
rename script?– roaima
Oct 16 '16 at 22:41
What UNIX flavour or Linux distribution are you using? Is there any particular reason why you haven't installed the missing
rename script?– roaima
Oct 16 '16 at 22:41
add a comment |
4 Answers
4
active
oldest
votes
up vote
0
down vote
It looks like you're forgetting to pass the files to rename.
rename 456 555 *456*
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaima it sounds like he had a script that usedrenameand he forgot how to userename, not that he doesn't haverenameat all.
– Zachary Brady
Oct 12 '16 at 21:27
Mmmm. Not convinced but given the poor question I'll go with that.
– roaima
Oct 12 '16 at 21:30
add a comment |
up vote
0
down vote
With only shell, using parameter expansion:
for f in *456*; do echo mv -i -- "$f" "${f//456/555}"; done
here we re iterating over the files having 456 in their names, and the parameter expansion pattern ${f//456/555} will replace all 456 substrings in the filename with 555.
The above will do the dry-run by showing what mv command will be run, you can remove echo to let the action take place:
for f in *456*; do mv -i -- "$f" "${f//456/555}"; done
With rename (prename):
rename -n 's/456/555/g' *456*
this will replace all (g) 456 substring from filenames with 555 (s/456/555/).
-n will do the dry-run, if you are satisfied with the changes to be made, remove -n to let the actual renaming take place:
rename 's/456/555/g' *456*
add a comment |
up vote
0
down vote
which -a rename
Will tell you if any rename tools are on your $PATH.
rename 's/456/555/g' *
Is the preferred syntax for doing what you want (As stated in the manual). If you have no or an old version of rename without regex just download (official) prename Which is a perl script debian like systems use.
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaina the OP is using rename wrong resulting in no action. Likely 'which rename' exists. Also if the OP really is missing it I informed him how to get it.
– user1133275
Oct 12 '16 at 21:30
Mmm ok. Perhaps.
– roaima
Oct 12 '16 at 21:35
add a comment |
up vote
0
down vote
(Moved from a question intended as an answer here)
I have found the answer to my question:
#! /bin/csh -f
#----------------------------------------------------------------------
# Script Name: moveme Date: 05/07/96
# Written by: John W. Woolsey Rev: 10/11/99
#
# Description:
# Renames a set of files that contain a particular search string
# to file names that contain a replacement string.
#
# Syntax: moveme <search_string> <replace_string>
#
# Where:
# <search_string> is the name of the file name search string.
# <replace_string> is the name of the file name replace string.
#----------------------------------------------------------------------
#
onintr catch
if ($#argv != 2) goto syntax
ls -d *$1* | sed "s/(.*)$1(.*)/mv & 1$22/" | sh
exit 0
syntax:
echo "Syntax: `basename $0` <search_string> <replace_string>"
exit 1
catch:
echo "`basename $0` was interrupted or terminated abnormally."
exit 1
Huh, acshscript that generateshcode...
– Kusalananda
Jul 28 at 17:28
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
It looks like you're forgetting to pass the files to rename.
rename 456 555 *456*
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaima it sounds like he had a script that usedrenameand he forgot how to userename, not that he doesn't haverenameat all.
– Zachary Brady
Oct 12 '16 at 21:27
Mmmm. Not convinced but given the poor question I'll go with that.
– roaima
Oct 12 '16 at 21:30
add a comment |
up vote
0
down vote
It looks like you're forgetting to pass the files to rename.
rename 456 555 *456*
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaima it sounds like he had a script that usedrenameand he forgot how to userename, not that he doesn't haverenameat all.
– Zachary Brady
Oct 12 '16 at 21:27
Mmmm. Not convinced but given the poor question I'll go with that.
– roaima
Oct 12 '16 at 21:30
add a comment |
up vote
0
down vote
up vote
0
down vote
It looks like you're forgetting to pass the files to rename.
rename 456 555 *456*
It looks like you're forgetting to pass the files to rename.
rename 456 555 *456*
answered Oct 12 '16 at 21:20
Zachary Brady
3,396932
3,396932
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaima it sounds like he had a script that usedrenameand he forgot how to userename, not that he doesn't haverenameat all.
– Zachary Brady
Oct 12 '16 at 21:27
Mmmm. Not convinced but given the poor question I'll go with that.
– roaima
Oct 12 '16 at 21:30
add a comment |
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaima it sounds like he had a script that usedrenameand he forgot how to userename, not that he doesn't haverenameat all.
– Zachary Brady
Oct 12 '16 at 21:27
Mmmm. Not convinced but given the poor question I'll go with that.
– roaima
Oct 12 '16 at 21:30
The OP said they no longer had
rename, so suggesting they use rename (of any flavour) doesn't seem particularly helpful.– roaima
Oct 12 '16 at 21:26
The OP said they no longer had
rename, so suggesting they use rename (of any flavour) doesn't seem particularly helpful.– roaima
Oct 12 '16 at 21:26
@roaima it sounds like he had a script that used
rename and he forgot how to use rename, not that he doesn't have rename at all.– Zachary Brady
Oct 12 '16 at 21:27
@roaima it sounds like he had a script that used
rename and he forgot how to use rename, not that he doesn't have rename at all.– Zachary Brady
Oct 12 '16 at 21:27
Mmmm. Not convinced but given the poor question I'll go with that.
– roaima
Oct 12 '16 at 21:30
Mmmm. Not convinced but given the poor question I'll go with that.
– roaima
Oct 12 '16 at 21:30
add a comment |
up vote
0
down vote
With only shell, using parameter expansion:
for f in *456*; do echo mv -i -- "$f" "${f//456/555}"; done
here we re iterating over the files having 456 in their names, and the parameter expansion pattern ${f//456/555} will replace all 456 substrings in the filename with 555.
The above will do the dry-run by showing what mv command will be run, you can remove echo to let the action take place:
for f in *456*; do mv -i -- "$f" "${f//456/555}"; done
With rename (prename):
rename -n 's/456/555/g' *456*
this will replace all (g) 456 substring from filenames with 555 (s/456/555/).
-n will do the dry-run, if you are satisfied with the changes to be made, remove -n to let the actual renaming take place:
rename 's/456/555/g' *456*
add a comment |
up vote
0
down vote
With only shell, using parameter expansion:
for f in *456*; do echo mv -i -- "$f" "${f//456/555}"; done
here we re iterating over the files having 456 in their names, and the parameter expansion pattern ${f//456/555} will replace all 456 substrings in the filename with 555.
The above will do the dry-run by showing what mv command will be run, you can remove echo to let the action take place:
for f in *456*; do mv -i -- "$f" "${f//456/555}"; done
With rename (prename):
rename -n 's/456/555/g' *456*
this will replace all (g) 456 substring from filenames with 555 (s/456/555/).
-n will do the dry-run, if you are satisfied with the changes to be made, remove -n to let the actual renaming take place:
rename 's/456/555/g' *456*
add a comment |
up vote
0
down vote
up vote
0
down vote
With only shell, using parameter expansion:
for f in *456*; do echo mv -i -- "$f" "${f//456/555}"; done
here we re iterating over the files having 456 in their names, and the parameter expansion pattern ${f//456/555} will replace all 456 substrings in the filename with 555.
The above will do the dry-run by showing what mv command will be run, you can remove echo to let the action take place:
for f in *456*; do mv -i -- "$f" "${f//456/555}"; done
With rename (prename):
rename -n 's/456/555/g' *456*
this will replace all (g) 456 substring from filenames with 555 (s/456/555/).
-n will do the dry-run, if you are satisfied with the changes to be made, remove -n to let the actual renaming take place:
rename 's/456/555/g' *456*
With only shell, using parameter expansion:
for f in *456*; do echo mv -i -- "$f" "${f//456/555}"; done
here we re iterating over the files having 456 in their names, and the parameter expansion pattern ${f//456/555} will replace all 456 substrings in the filename with 555.
The above will do the dry-run by showing what mv command will be run, you can remove echo to let the action take place:
for f in *456*; do mv -i -- "$f" "${f//456/555}"; done
With rename (prename):
rename -n 's/456/555/g' *456*
this will replace all (g) 456 substring from filenames with 555 (s/456/555/).
-n will do the dry-run, if you are satisfied with the changes to be made, remove -n to let the actual renaming take place:
rename 's/456/555/g' *456*
edited Oct 12 '16 at 21:27
answered Oct 12 '16 at 21:21
heemayl
34.2k371101
34.2k371101
add a comment |
add a comment |
up vote
0
down vote
which -a rename
Will tell you if any rename tools are on your $PATH.
rename 's/456/555/g' *
Is the preferred syntax for doing what you want (As stated in the manual). If you have no or an old version of rename without regex just download (official) prename Which is a perl script debian like systems use.
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaina the OP is using rename wrong resulting in no action. Likely 'which rename' exists. Also if the OP really is missing it I informed him how to get it.
– user1133275
Oct 12 '16 at 21:30
Mmm ok. Perhaps.
– roaima
Oct 12 '16 at 21:35
add a comment |
up vote
0
down vote
which -a rename
Will tell you if any rename tools are on your $PATH.
rename 's/456/555/g' *
Is the preferred syntax for doing what you want (As stated in the manual). If you have no or an old version of rename without regex just download (official) prename Which is a perl script debian like systems use.
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaina the OP is using rename wrong resulting in no action. Likely 'which rename' exists. Also if the OP really is missing it I informed him how to get it.
– user1133275
Oct 12 '16 at 21:30
Mmm ok. Perhaps.
– roaima
Oct 12 '16 at 21:35
add a comment |
up vote
0
down vote
up vote
0
down vote
which -a rename
Will tell you if any rename tools are on your $PATH.
rename 's/456/555/g' *
Is the preferred syntax for doing what you want (As stated in the manual). If you have no or an old version of rename without regex just download (official) prename Which is a perl script debian like systems use.
which -a rename
Will tell you if any rename tools are on your $PATH.
rename 's/456/555/g' *
Is the preferred syntax for doing what you want (As stated in the manual). If you have no or an old version of rename without regex just download (official) prename Which is a perl script debian like systems use.
edited Oct 13 '16 at 4:15
answered Oct 12 '16 at 21:23
user1133275
2,667415
2,667415
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaina the OP is using rename wrong resulting in no action. Likely 'which rename' exists. Also if the OP really is missing it I informed him how to get it.
– user1133275
Oct 12 '16 at 21:30
Mmm ok. Perhaps.
– roaima
Oct 12 '16 at 21:35
add a comment |
The OP said they no longer hadrename, so suggesting they userename(of any flavour) doesn't seem particularly helpful.
– roaima
Oct 12 '16 at 21:26
@roaina the OP is using rename wrong resulting in no action. Likely 'which rename' exists. Also if the OP really is missing it I informed him how to get it.
– user1133275
Oct 12 '16 at 21:30
Mmm ok. Perhaps.
– roaima
Oct 12 '16 at 21:35
The OP said they no longer had
rename, so suggesting they use rename (of any flavour) doesn't seem particularly helpful.– roaima
Oct 12 '16 at 21:26
The OP said they no longer had
rename, so suggesting they use rename (of any flavour) doesn't seem particularly helpful.– roaima
Oct 12 '16 at 21:26
@roaina the OP is using rename wrong resulting in no action. Likely 'which rename' exists. Also if the OP really is missing it I informed him how to get it.
– user1133275
Oct 12 '16 at 21:30
@roaina the OP is using rename wrong resulting in no action. Likely 'which rename' exists. Also if the OP really is missing it I informed him how to get it.
– user1133275
Oct 12 '16 at 21:30
Mmm ok. Perhaps.
– roaima
Oct 12 '16 at 21:35
Mmm ok. Perhaps.
– roaima
Oct 12 '16 at 21:35
add a comment |
up vote
0
down vote
(Moved from a question intended as an answer here)
I have found the answer to my question:
#! /bin/csh -f
#----------------------------------------------------------------------
# Script Name: moveme Date: 05/07/96
# Written by: John W. Woolsey Rev: 10/11/99
#
# Description:
# Renames a set of files that contain a particular search string
# to file names that contain a replacement string.
#
# Syntax: moveme <search_string> <replace_string>
#
# Where:
# <search_string> is the name of the file name search string.
# <replace_string> is the name of the file name replace string.
#----------------------------------------------------------------------
#
onintr catch
if ($#argv != 2) goto syntax
ls -d *$1* | sed "s/(.*)$1(.*)/mv & 1$22/" | sh
exit 0
syntax:
echo "Syntax: `basename $0` <search_string> <replace_string>"
exit 1
catch:
echo "`basename $0` was interrupted or terminated abnormally."
exit 1
Huh, acshscript that generateshcode...
– Kusalananda
Jul 28 at 17:28
add a comment |
up vote
0
down vote
(Moved from a question intended as an answer here)
I have found the answer to my question:
#! /bin/csh -f
#----------------------------------------------------------------------
# Script Name: moveme Date: 05/07/96
# Written by: John W. Woolsey Rev: 10/11/99
#
# Description:
# Renames a set of files that contain a particular search string
# to file names that contain a replacement string.
#
# Syntax: moveme <search_string> <replace_string>
#
# Where:
# <search_string> is the name of the file name search string.
# <replace_string> is the name of the file name replace string.
#----------------------------------------------------------------------
#
onintr catch
if ($#argv != 2) goto syntax
ls -d *$1* | sed "s/(.*)$1(.*)/mv & 1$22/" | sh
exit 0
syntax:
echo "Syntax: `basename $0` <search_string> <replace_string>"
exit 1
catch:
echo "`basename $0` was interrupted or terminated abnormally."
exit 1
Huh, acshscript that generateshcode...
– Kusalananda
Jul 28 at 17:28
add a comment |
up vote
0
down vote
up vote
0
down vote
(Moved from a question intended as an answer here)
I have found the answer to my question:
#! /bin/csh -f
#----------------------------------------------------------------------
# Script Name: moveme Date: 05/07/96
# Written by: John W. Woolsey Rev: 10/11/99
#
# Description:
# Renames a set of files that contain a particular search string
# to file names that contain a replacement string.
#
# Syntax: moveme <search_string> <replace_string>
#
# Where:
# <search_string> is the name of the file name search string.
# <replace_string> is the name of the file name replace string.
#----------------------------------------------------------------------
#
onintr catch
if ($#argv != 2) goto syntax
ls -d *$1* | sed "s/(.*)$1(.*)/mv & 1$22/" | sh
exit 0
syntax:
echo "Syntax: `basename $0` <search_string> <replace_string>"
exit 1
catch:
echo "`basename $0` was interrupted or terminated abnormally."
exit 1
(Moved from a question intended as an answer here)
I have found the answer to my question:
#! /bin/csh -f
#----------------------------------------------------------------------
# Script Name: moveme Date: 05/07/96
# Written by: John W. Woolsey Rev: 10/11/99
#
# Description:
# Renames a set of files that contain a particular search string
# to file names that contain a replacement string.
#
# Syntax: moveme <search_string> <replace_string>
#
# Where:
# <search_string> is the name of the file name search string.
# <replace_string> is the name of the file name replace string.
#----------------------------------------------------------------------
#
onintr catch
if ($#argv != 2) goto syntax
ls -d *$1* | sed "s/(.*)$1(.*)/mv & 1$22/" | sh
exit 0
syntax:
echo "Syntax: `basename $0` <search_string> <replace_string>"
exit 1
catch:
echo "`basename $0` was interrupted or terminated abnormally."
exit 1
edited Apr 13 '17 at 12:36
community wiki
2 revs
Michael Mrozek
Huh, acshscript that generateshcode...
– Kusalananda
Jul 28 at 17:28
add a comment |
Huh, acshscript that generateshcode...
– Kusalananda
Jul 28 at 17:28
Huh, a
csh script that generate sh code...– Kusalananda
Jul 28 at 17:28
Huh, a
csh script that generate sh code...– Kusalananda
Jul 28 at 17:28
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f316038%2fchange-part-of-the-filename-on-multiple-files-in-a-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What's the question? Do you want help writing a script? Finding it? Making use of alternatives? Solving this specific problem of changing
456to555? Please edit your text to include a question. And while you're there please tell us your UNIX flavour or Linux distribution.– roaima
Oct 12 '16 at 21:17
yes, i need a script that i can used from the command line. I am still new to Unix. What i do is "ls * (file names)" to a temp file name. then do a search %/s/456/555/g. then move all old file names to new file names. I was able to do this in a command line "rename $1 to $2". So, in any given directory i would line to rename middle of file names. It could be hundred of files. Hope this make sense, Thanks.
– ivan
Oct 13 '16 at 13:30
What UNIX flavour or Linux distribution are you using? Is there any particular reason why you haven't installed the missing
renamescript?– roaima
Oct 16 '16 at 22:41