/usr/bin/rename: Argument list too longHow would I batch rename a lot of files using command-line?Argument list too long when copying filesfind/tar combination to backup certain files at one level, and all files in one subdirectoryFind folders of size lesser than x and delete themArgument list too long when removing files in trashCannot use command line Argument list too longunable to execute /usr/bin/apt-get: Argument list too long
Was there a clearly identifiable "first computer" to use or demonstrate the use of virtual memory?
"Cобака на сене" - is this expression still in use or is it dated?
"Ich habe Durst" vs "Ich bin durstig": Which is more common?
How much money is needed to prove you can support yourself with ESTA
Why do some papers have so many co-authors?
Is it a good idea to contact a candidate?
Does single-stepping on the 8086 behave as described in the user manual?
Why are circuit results different from theorised?
"Chess is 90% tactics" - should a player focus more on tactics in order to improve?
Spacing between ArcMap class name and description in the legend
Polling on Impeachment
Why did the Bohr Model Successfully calculate some of the energy levels in hydrogen?
Given an array A[] and a number x, check for pair in A[] with sum as x
My name causes an issue with any booking! (names end with MR and MRS)
How do I resolve science-based problems in my worldbuilding?
Rashi's explanation of why we are told that Avram was 86 at the birth of Yishma'el
Surfacing out of a sunken ship/submarine - Survival Tips
Is it sportsmanlike to waste opponents' time by giving check at the end of the game?
What would make the internet go away?
What's an "add" chord?
Where is BepiColombo?
How can a Human Druid achieve expert proficiency with a weapon?
Calculations in shell Unix
Why does Smaug have 4 legs in the 1st movie but only 2 legs in the 2nd?
/usr/bin/rename: Argument list too long
How would I batch rename a lot of files using command-line?Argument list too long when copying filesfind/tar combination to backup certain files at one level, and all files in one subdirectoryFind folders of size lesser than x and delete themArgument list too long when removing files in trashCannot use command line Argument list too longunable to execute /usr/bin/apt-get: Argument list too long
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I'm trying to rename a bunch of files and folders.
I tried this command rename 's/test/test2/' but I got unable to execute /usr/bin/rename: Argument list too long
I searched a lot and tried different solutions but I'm not getting it.
The last one I tried was this one find . -type f -exec rename -n 's/test/test2/' ** ; which I also got the same error.
Thank you!
Edit: Also tried xargs -0 rename -n 's/test/test2/' ** and I got xargs: cannot fit single argument within argument list size limit
command-line bash rename batch-rename
add a comment
|
I'm trying to rename a bunch of files and folders.
I tried this command rename 's/test/test2/' but I got unable to execute /usr/bin/rename: Argument list too long
I searched a lot and tried different solutions but I'm not getting it.
The last one I tried was this one find . -type f -exec rename -n 's/test/test2/' ** ; which I also got the same error.
Thank you!
Edit: Also tried xargs -0 rename -n 's/test/test2/' ** and I got xargs: cannot fit single argument within argument list size limit
command-line bash rename batch-rename
add a comment
|
I'm trying to rename a bunch of files and folders.
I tried this command rename 's/test/test2/' but I got unable to execute /usr/bin/rename: Argument list too long
I searched a lot and tried different solutions but I'm not getting it.
The last one I tried was this one find . -type f -exec rename -n 's/test/test2/' ** ; which I also got the same error.
Thank you!
Edit: Also tried xargs -0 rename -n 's/test/test2/' ** and I got xargs: cannot fit single argument within argument list size limit
command-line bash rename batch-rename
I'm trying to rename a bunch of files and folders.
I tried this command rename 's/test/test2/' but I got unable to execute /usr/bin/rename: Argument list too long
I searched a lot and tried different solutions but I'm not getting it.
The last one I tried was this one find . -type f -exec rename -n 's/test/test2/' ** ; which I also got the same error.
Thank you!
Edit: Also tried xargs -0 rename -n 's/test/test2/' ** and I got xargs: cannot fit single argument within argument list size limit
command-line bash rename batch-rename
command-line bash rename batch-rename
edited Jul 21 at 16:52
Kulcanhez
asked Jul 21 at 16:41
KulcanhezKulcanhez
112 bronze badges
112 bronze badges
add a comment
|
add a comment
|
2 Answers
2
active
oldest
votes
You want
find . -type f -exec rename -n 's/test/test2/' +
The -exec ... + form will put as many arguments as can fit, so it will invoke rename as few times as possible.
Your mistake was using find ... -exec and also putting ** on rename's argument list.
It works with the -n argument but if I take it out I gotunable to execute /usr/bin/rename: Argument list too longhowever it lists all the files and folder it was supposed to change but sayingNo such file or directory
– Kulcanhez
Jul 21 at 20:36
add a comment
|
It sounds to me like you have a file with an extremely long file name.
To find the top 5 longest file names in a given directory, use the following (replacing /etc with the path in question)
ls /etc | perl -e 'print sort length($b) <=> length($a) <>' | head -5
If you do have a filename that is absurdly long, you may be able to first rename it using the 'mv' command to a shorter name.
Maybe I have but I can't change it cause it would involve changing a lot of inner code.
– Kulcanhez
Jul 21 at 20:37
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2faskubuntu.com%2fquestions%2f1159948%2fusr-bin-rename-argument-list-too-long%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You want
find . -type f -exec rename -n 's/test/test2/' +
The -exec ... + form will put as many arguments as can fit, so it will invoke rename as few times as possible.
Your mistake was using find ... -exec and also putting ** on rename's argument list.
It works with the -n argument but if I take it out I gotunable to execute /usr/bin/rename: Argument list too longhowever it lists all the files and folder it was supposed to change but sayingNo such file or directory
– Kulcanhez
Jul 21 at 20:36
add a comment
|
You want
find . -type f -exec rename -n 's/test/test2/' +
The -exec ... + form will put as many arguments as can fit, so it will invoke rename as few times as possible.
Your mistake was using find ... -exec and also putting ** on rename's argument list.
It works with the -n argument but if I take it out I gotunable to execute /usr/bin/rename: Argument list too longhowever it lists all the files and folder it was supposed to change but sayingNo such file or directory
– Kulcanhez
Jul 21 at 20:36
add a comment
|
You want
find . -type f -exec rename -n 's/test/test2/' +
The -exec ... + form will put as many arguments as can fit, so it will invoke rename as few times as possible.
Your mistake was using find ... -exec and also putting ** on rename's argument list.
You want
find . -type f -exec rename -n 's/test/test2/' +
The -exec ... + form will put as many arguments as can fit, so it will invoke rename as few times as possible.
Your mistake was using find ... -exec and also putting ** on rename's argument list.
answered Jul 21 at 17:52
glenn jackmanglenn jackman
13.4k27 silver badges47 bronze badges
13.4k27 silver badges47 bronze badges
It works with the -n argument but if I take it out I gotunable to execute /usr/bin/rename: Argument list too longhowever it lists all the files and folder it was supposed to change but sayingNo such file or directory
– Kulcanhez
Jul 21 at 20:36
add a comment
|
It works with the -n argument but if I take it out I gotunable to execute /usr/bin/rename: Argument list too longhowever it lists all the files and folder it was supposed to change but sayingNo such file or directory
– Kulcanhez
Jul 21 at 20:36
It works with the -n argument but if I take it out I got
unable to execute /usr/bin/rename: Argument list too long however it lists all the files and folder it was supposed to change but saying No such file or directory– Kulcanhez
Jul 21 at 20:36
It works with the -n argument but if I take it out I got
unable to execute /usr/bin/rename: Argument list too long however it lists all the files and folder it was supposed to change but saying No such file or directory– Kulcanhez
Jul 21 at 20:36
add a comment
|
It sounds to me like you have a file with an extremely long file name.
To find the top 5 longest file names in a given directory, use the following (replacing /etc with the path in question)
ls /etc | perl -e 'print sort length($b) <=> length($a) <>' | head -5
If you do have a filename that is absurdly long, you may be able to first rename it using the 'mv' command to a shorter name.
Maybe I have but I can't change it cause it would involve changing a lot of inner code.
– Kulcanhez
Jul 21 at 20:37
add a comment
|
It sounds to me like you have a file with an extremely long file name.
To find the top 5 longest file names in a given directory, use the following (replacing /etc with the path in question)
ls /etc | perl -e 'print sort length($b) <=> length($a) <>' | head -5
If you do have a filename that is absurdly long, you may be able to first rename it using the 'mv' command to a shorter name.
Maybe I have but I can't change it cause it would involve changing a lot of inner code.
– Kulcanhez
Jul 21 at 20:37
add a comment
|
It sounds to me like you have a file with an extremely long file name.
To find the top 5 longest file names in a given directory, use the following (replacing /etc with the path in question)
ls /etc | perl -e 'print sort length($b) <=> length($a) <>' | head -5
If you do have a filename that is absurdly long, you may be able to first rename it using the 'mv' command to a shorter name.
It sounds to me like you have a file with an extremely long file name.
To find the top 5 longest file names in a given directory, use the following (replacing /etc with the path in question)
ls /etc | perl -e 'print sort length($b) <=> length($a) <>' | head -5
If you do have a filename that is absurdly long, you may be able to first rename it using the 'mv' command to a shorter name.
answered Jul 21 at 17:05
Rob SweetRob Sweet
413 bronze badges
413 bronze badges
Maybe I have but I can't change it cause it would involve changing a lot of inner code.
– Kulcanhez
Jul 21 at 20:37
add a comment
|
Maybe I have but I can't change it cause it would involve changing a lot of inner code.
– Kulcanhez
Jul 21 at 20:37
Maybe I have but I can't change it cause it would involve changing a lot of inner code.
– Kulcanhez
Jul 21 at 20:37
Maybe I have but I can't change it cause it would involve changing a lot of inner code.
– Kulcanhez
Jul 21 at 20:37
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f1159948%2fusr-bin-rename-argument-list-too-long%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