So I have a bunch of files like:
Aaron Lewis - Country Boy.cdg
Aaron Lewis - Country Boy.mp3
Adele - Rolling In The Deep.cdg
Adele - Rolling In The Deep.mp3
Adele - Set Fire To The Rain.cdg
Adele - Set Fire To The Rain.mp3
Band Perry - Better Dig Two.cdg
Band Perry - Better Dig Two.mp3
Band Perry - Pioneer.cdg
Band Perry - Pioneer.mp3
and I need to have the leading whitespace removed in bash or fish script.
To remove the leading white space char in the file names you provided you can use:
IFS=$'\n'
for f in $(find . -type f -name ' *')
do
mv $f ${f/\.\/ /\.\/}
done
This:
bash
substring substitution.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With