4 replaced http://stackoverflow.com/ with https://stackoverflow.com/
source | link

This answerThis answer from Alex B at Stack Overflow will help you to rename both files and subfolders under a directory.

It consists on using both find and rename Linux commands. I would only add that the command provided in the link above will modify directory names as well. In case that you want only to change file names, you need to change the -depth option with the next one: -type f.

Another regular expression given to the rename command could be the one below, which I think it is more easy to understand.

 find my_root_dir -type f -execdir rename 'y/A-Z/a-z/' {} \;

Be aware that there is a necessary white space between the rename command regular expression and the curly braces, and another one between them and the command termination character \;

Also remember that it will rename every file not only in the directory where you execute the command from (the my_root_dir directory) but also to all the files under every subfolder contained into this one. You can use the -maxdepth 0 option with the find command to force it to only apply the tests and actions to the starting-points themselves.

This answer from Alex B at Stack Overflow will help you to rename both files and subfolders under a directory.

It consists on using both find and rename Linux commands. I would only add that the command provided in the link above will modify directory names as well. In case that you want only to change file names, you need to change the -depth option with the next one: -type f.

Another regular expression given to the rename command could be the one below, which I think it is more easy to understand.

 find my_root_dir -type f -execdir rename 'y/A-Z/a-z/' {} \;

Be aware that there is a necessary white space between the rename command regular expression and the curly braces, and another one between them and the command termination character \;

Also remember that it will rename every file not only in the directory where you execute the command from (the my_root_dir directory) but also to all the files under every subfolder contained into this one. You can use the -maxdepth 0 option with the find command to force it to only apply the tests and actions to the starting-points themselves.

This answer from Alex B at Stack Overflow will help you to rename both files and subfolders under a directory.

It consists on using both find and rename Linux commands. I would only add that the command provided in the link above will modify directory names as well. In case that you want only to change file names, you need to change the -depth option with the next one: -type f.

Another regular expression given to the rename command could be the one below, which I think it is more easy to understand.

 find my_root_dir -type f -execdir rename 'y/A-Z/a-z/' {} \;

Be aware that there is a necessary white space between the rename command regular expression and the curly braces, and another one between them and the command termination character \;

Also remember that it will rename every file not only in the directory where you execute the command from (the my_root_dir directory) but also to all the files under every subfolder contained into this one. You can use the -maxdepth 0 option with the find command to force it to only apply the tests and actions to the starting-points themselves.

3 deleted 136 characters in body
source | link

This answer from Alex B at Stack Overflow will help you to rename both files and subfolders under a directory.

It consists on using both find and rename Linux commands. I would only add that the command provided in the link above will modify directory names as well. In case that you want only to change file names, you need to change the -depth option with the next one: -type f so the command that you need to execute looks like below.

find my_root_dir -type f -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;

Another regular expression given to the rename command could be the one below, which I think it is more easy to understand.

 find my_root_dir -type f -execdir rename 'y/A-Z/a-z/' {} \;

Be aware that there is a necessary white space between the rename command regular expression and the curly braces, and another one between them and the command termination character \;

Also remember that it will rename every file not only in the directory where you execute the command from (the my_root_dir directory) but also to all the files under every subfolder contained into this one. You can use the -maxdepth 0 option with the find command to force it to only apply the tests and actions to the starting-points themselves.

This answer from Alex B at Stack Overflow will help you to rename both files and subfolders under a directory.

It consists on using both find and rename Linux commands. I would only add that the command provided in the link above will modify directory names as well. In case that you want only to change file names, you need to change the -depth option with the next one: -type f so the command that you need to execute looks like below

find my_root_dir -type f -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;

Another regular expression given to the rename command could be the one below, which I think it is more easy to understand.

 find my_root_dir -type f -execdir rename 'y/A-Z/a-z/' {} \;

Be aware that there is a necessary white space between the rename command regular expression and the curly braces, and another one between them and the command termination character \;

Also remember that it will rename every file not only in the directory where you execute the command from (the my_root_dir directory) but also to all the files under every subfolder contained into this one. You can use the -maxdepth 0 option with the find command to force it to only apply the tests and actions to the starting-points themselves.

This answer from Alex B at Stack Overflow will help you to rename both files and subfolders under a directory.

It consists on using both find and rename Linux commands. I would only add that the command provided in the link above will modify directory names as well. In case that you want only to change file names, you need to change the -depth option with the next one: -type f.

Another regular expression given to the rename command could be the one below, which I think it is more easy to understand.

 find my_root_dir -type f -execdir rename 'y/A-Z/a-z/' {} \;

Be aware that there is a necessary white space between the rename command regular expression and the curly braces, and another one between them and the command termination character \;

Also remember that it will rename every file not only in the directory where you execute the command from (the my_root_dir directory) but also to all the files under every subfolder contained into this one. You can use the -maxdepth 0 option with the find command to force it to only apply the tests and actions to the starting-points themselves.

2 Fixed regular expression for the `rename` command and added `-execdir` option to `find`
source | link

This answer from Alex B at Stack Overflow will help you to rename both files and subfolders under a directory.

It consists on using both find and rename Linux commands. I would only add that the command provided in the link above will modify directory names as well. In case that you want only to change file names, you need to change the -depth option with the next one: -type f so the command that you need to execute looks like below

find my_root_dir -type f -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;

Another regular expression given to the rename command could be the one below, which I think it is more easy to understand.

 find my_root_dir -type f -execexecdir rename 'y/A-Z/a-z'z/' {} \;

Be aware that there is a necessary white space between the rename command regular expression and the curly braces, and another one between them and the command termination character \;

Also remember that it will rename every file not only in the directory where you execute the command from (the my_root_dir directory) but also to all the files under every subfolder contained into this one. You can use the -maxdepth 0 option with the find command to force it to only apply the tests and actions to the starting-points themselves.

This answer from Alex B at Stack Overflow will help you to rename both files and subfolders under a directory.

It consists on using both find and rename Linux commands. I would only add that the command provided in the link above will modify directory names as well. In case that you want only to change file names, you need to change the -depth option with the next one: -type f so the command that you need to execute looks like below

find my_root_dir -type f -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;

Another regular expression given to the rename command could be the one below, which I think it is more easy to understand.

 find my_root_dir -type f -exec rename 'y/A-Z/a-z' {} \;

Be aware that there is a necessary white space between the rename command regular expression and the curly braces, and another one between them and the command termination character \;

Also remember that it will rename every file not only in the directory where you execute the command from (the my_root_dir directory) but also to all the files under every subfolder contained into this one. You can use the -maxdepth 0 option with the find command to force it to only apply the tests and actions to the starting-points themselves.

This answer from Alex B at Stack Overflow will help you to rename both files and subfolders under a directory.

It consists on using both find and rename Linux commands. I would only add that the command provided in the link above will modify directory names as well. In case that you want only to change file names, you need to change the -depth option with the next one: -type f so the command that you need to execute looks like below

find my_root_dir -type f -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;

Another regular expression given to the rename command could be the one below, which I think it is more easy to understand.

 find my_root_dir -type f -execdir rename 'y/A-Z/a-z/' {} \;

Be aware that there is a necessary white space between the rename command regular expression and the curly braces, and another one between them and the command termination character \;

Also remember that it will rename every file not only in the directory where you execute the command from (the my_root_dir directory) but also to all the files under every subfolder contained into this one. You can use the -maxdepth 0 option with the find command to force it to only apply the tests and actions to the starting-points themselves.

1
source | link