[SOLVED]Is it possible to modify a batch of file names...?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
[SOLVED]Is it possible to modify a batch of file names...?
I have a number of pictures that I want to resize using Imagemagick - the files were saved with spaces in the file names which seems to be incompatible with IM. Is there a way that I can remove the spaces from the file names other than manually renaming each one . . . ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Is it possible to modify a batch of file names...?
Just use quotes for filenames with spaces or other special characters in them.
Re: Is it possible to modify a batch of file names...?
Check out this page. The
To remove spaces
should come real close to replacing any space characters with the under-score character. The 'g' should replace any number occurrences. The '-v' argument just makes it verbose.
rename
works a real treat.To remove spaces
Code: Select all
rename -v 's/\ /_/g' *