![]() Rename(ABC/ABC2/aa2.bin, ABC/ABC2/ABC2-aa2.bin) Rename(ABC/ABC1/bb1.bin, ABC/ABC1/ABC1-bb1.bin) ![]() If the result is the expected one, remove the -n option from the rename command. bin, skips to the next filename sets the output field separator to / splits the filename on / prepends the second to last field followed by - to the last field assigns the new filename to the default variable ( $_). For each filename resulting from the ** globbing: if the file is not a regular file or the filename doesn't end with. rename -n '! -f $_ & next $" = "/" my = split("/") =~ $_ = **: performs a dry-run of the following.If the pattern is followed by a '/', only directories and subdirectories match. shopt -s globstar: If set, the pattern '**' used in a filename expansion context will match all files and zero or more directories and subdirectories.Here's a "one-liner" to do, using shell built-ins to manipulate the filenames: find.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |