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

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User