1 |
On Monday 2 July 2007 22:59, Mick wrote: |
2 |
> Hi All, |
3 |
> |
4 |
> I backed up my wife's WinXP fs using K3B and I used default settings |
5 |
> which unfortunately converted all file names to CAPITALS and shortened |
6 |
> them to 8 characters maximum, just like DOS would do. Is there a |
7 |
> clever way to change some of them back to lower case (in batches |
8 |
> within given directorates) so that she doesn't have to do it manually |
9 |
> one by one? I do not want to change the access times, only the |
10 |
> filename case letters. |
11 |
|
12 |
Assuming there are no spaces in the names, something like: |
13 |
|
14 |
cd $targetdir |
15 |
|
16 |
for n in *; do |
17 |
|
18 |
newname=`echo $n | tr -s 'A-Z' 'a-z'` |
19 |
mv $n $newname |
20 |
|
21 |
done |
22 |
|
23 |
should work. It might be possile to do the same using bash alone, but I'm |
24 |
too lazy to check now. |
25 |
-- |
26 |
gentoo-user@g.o mailing list |