Linux wildcard, wildcard
Linux wildcard % c is different from * c
%. C is the GUNmake syntax layer, indicating all files ending with ". c"
*. C is the syntax layer of linux shell, such as rm-f *. o.
The meaning is basically the same, that is, GUNmake and shell.
Wildcards are not allowed in the linux Command mv.
It cannot be implemented through scripts.
Simply relying on the music video command, you need to implement it manually.
Compile the script rename as follows:
#----------------------------------------------
#! /Bin/sh
Ls-l $1 | grep ^ [^ d] | awk '{print $9}' | while read line; do
Do = 'echo $ line | grep $2'
If [! "$ Do" = ""]; then
Newname = 'echo $ line | sed's/'$ 2'/' $ 3'/G''
Echo "rename $ line to $ newname ..."
Mv $1/$ line $1/$ newname
Fi
Done
#------------------------------------------------
Save the above as a rename file,
Then run
Chmod + x rename
Enable rename to run
Then run rename in the following format:
Assume that rename is in the current path
$./Rename [fullpathtofiles]. JPG. jpg
[Fullpathtofiles] is the full file path.