OK, OK, minha nova variante:
$ touch boo$'\n'
$ touch foo$'\n'
$ ls -l
total 4
-rw-r--r-- 1 user user 54 Feb 9 12:16 111.sh
-rw-r--r-- 1 user user 0 Feb 9 12:17 boo?
-rw-r--r-- 1 user user 0 Feb 9 12:17 foo?
$ sh 111.sh
$ ls -l
total 4
-rw-r--r-- 1 user user 54 Feb 9 12:16 111.sh
-rw-r--r-- 1 user user 0 Feb 9 12:17 boo
-rw-r--r-- 1 user user 0 Feb 9 12:17 foo
$ cat 111.sh
for i in 'find ./ -name '*
''
do
mv $i$'\n' $i
done
$
Variante antiga (errada):
Uso:
find ./ -name "*\n" | sed 's/\(.*\)\n/mv \\n\ /'
para criar lista de comandos de renomeação. E então basta copiar / colar todos esses comandos para o terminal.
Exemplo:
$ touch 111\n
$ touch 222\n
$ ls -l
total 0
-rw-r--r-- 1 user user 0 Feb 9 11:15 111\n
-rw-r--r-- 1 user user 0 Feb 9 11:15 222\n
$ find ./ -name "*\n" | sed 's/\(.*\)\n/mv \\n\ /'
mv ./111\n ./111
mv ./222\n ./222
$ mv ./111\n ./111
$ mv ./222\n ./222
$ ls -l
total 0
-rw-r--r-- 1 user user 0 Feb 9 11:15 111
-rw-r--r-- 1 user user 0 Feb 9 11:15 222
$