Re: Dateinamen kürzen
Hallo Michelle,
Michelle Konzack <linux4michelle@freenet.de> wrote:
> Am 2006-06-29 23:13:15, schrieb Frank Terbeck:
>> for file in *.tar.gz.done ; do mv -i $file ${file%.done} ; done
>
> Uff... - Das verändert die "ctime" und "mtime"!
Nein. Die mtime wird von mv nicht angefasst -- die Datei wird doch nicht
modifiziert.
> Wie währe es mit:
>
> find -type f -name "*.done" -exec rename "s/\.done//" {}';'
Das gleiche.
% touch bla; stat bla
File: ?bla?
Size: 0 Blocks: 0 IO Block: 4096 reguläre leere Datei
Device: fh/15d Inode: 368233 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ joerg) Gid: ( 100/ users)
Access: 2006-08-18 14:10:46.000000000 +0200
Modify: 2006-08-18 14:10:46.000000000 +0200
Change: 2006-08-18 14:10:46.000000000 +0200
% mv bla foo; stat foo
File: ?foo?
Size: 0 Blocks: 0 IO Block: 4096 reguläre leere Datei
Device: fh/15d Inode: 368233 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ joerg) Gid: ( 100/ users)
Access: 2006-08-18 14:10:46.000000000 +0200
Modify: 2006-08-18 14:10:46.000000000 +0200
Change: 2006-08-18 14:11:09.634491311 +0200
% rename 's/foo/blubb/' foo; stat blubb
File: ?blubb?
Size: 0 Blocks: 0 IO Block: 4096 reguläre leere Datei
Device: fh/15d Inode: 368233 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ joerg) Gid: ( 100/ users)
Access: 2006-08-18 14:10:46.000000000 +0200
Modify: 2006-08-18 14:10:46.000000000 +0200
Change: 2006-08-18 14:11:24.167221311 +0200
Schöne Grüße, Jörg.
--
"Science is the game we play with God to find out what his rules are."
Reply to: