I have a folder, and inside this folder I have 10-15 files with arbitrary names. File names may contain spaces. For example: wWw.page.com __ (576)_002 . In the terminal, when I press w and then tab , the file name looks like this: wWw.page.com\ \ __\ \(576\)_0.txt .
I need a script that renames all my files, such as 0.txt , 1.txt , 2.txt , etc.
My problem: wWw.page.com __ (576)_002.txt file not found .
index=0; for i in $(ls *.txt) do cp "${i}" $index".txt" done
Lukap source share