If you are on a linux, check special rename
command which would do just that – renaming using regular expressions.
rename 's/^images\/(.+)/test\/$1.png/s' images/*.png
Otherwise, write a bash cycle over the filenames as catwalk suggested.
More Related Contents:
- Awk – replace coumn 2 in table 1 from coumn 2 in table 2 based on matching data in column 1 (common between tables)
- bash regex with quotes?
- Find and kill a process in one line using bash and regex
- RE error: illegal byte sequence on Mac OS X
- Bash Regular Expression — Can’t seem to match any of \s \S \d \D \w \W etc
- How to extract text from a string using sed?
- Check if a string matches a regex in Bash script
- How to match digits in regex in bash script
- Regular expressions in a Bash case statement
- Regex matching in a Bash if statement
- How do you extract IP addresses from files using a regex in a linux shell?
- Bash, grep between two lines with specified string
- Fully qualified domain name validation
- Why is sed not recognizing \t as a tab?
- What does ‘\K’ mean in this regex?
- Insert linefeed in sed (Mac OS X)
- Does bash support word boundary regular expressions?
- How do I use a regex in a shell script?
- Remove duplicates from text file based on second text file
- How to match a pattern given in a variable in awk?
- Replace a word with multiple lines using sed?
- replace a unknown string between two known strings with sed
- Recursively change file extensions in Bash
- How can I match a string with a regex in Bash?
- Why does BASH_REMATCH not work for a quoted regular expression?
- How can I match spaces with a regexp in Bash?
- How to change date format in sed?
- How to execute a Bash command only if a Docker container with a given name does not exist?
- Bash – Regex for HTML contents
- How to extract domain name from url?