The Stack Overflow podcast is back! Listen to an interview with our new CEO.
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 10788

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.

5
votes
There is also mmv: mmv -n "*.mp4*" "#1.mp4" Remove the "-n" when output looks right.
answered Jan 11 '12 by daniel kullmann
1
vote
using the printf command. This just prints the commands to stdout, so you can check whether you like the output. Remove the leading "echo" from line 4 when you want to rename for real. …
answered May 13 '14 by daniel kullmann
1
vote
In case you want to know what went wrong in your version: You used $files instead of $x in the basename command. So this should work (untested, though): for x in *.txt do mv "$x" "`basename '$x' .t …
answered Feb 18 '15 by daniel kullmann
0
votes
Or use mmv: mmv "*17.log" "#1\13.log"
answered Jan 17 '12 by daniel kullmann
21
votes
Let me start by asking another question: What is the difference between cp and cp -R? Well, without the -R flag, it's only possible to copy files, because it's rather unusual that someone wants to …
answered Aug 22 '12 by daniel kullmann