command line - Need help with a bash script - Ask Ubuntu
i'm having problems figuring out how bash script since i'm new bash. want grab files have in directory, change names (i think changing names part can done mv) , move them directory (again mv). problem files not have extension. named after numbers so: 1, 2, 3 etc. number. how grab each extensionless file, change name , move it?
thank you.
you can use extended globbing search files digits in names:
shopt -s extglob file in +([0-9]) ; newname=newpath/... # build new name. mv "$file" "$newname" done
Comments
Post a Comment