* [gentoo-user-de] Tote Symlinks finden und löschen
@ 2007-07-24 9:49 Andreas Stallmann
2007-07-24 10:00 ` Dirk Heinrichs
2007-07-24 10:10 ` Hans-Werner Hilse
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Stallmann @ 2007-07-24 9:49 UTC (permalink / raw
To: gentoo-user-de
Moin!
Mein Backup spinnt rum, weil leider einige zu sichernde Symlinks ins
Leere zeigen. Jetzt würde ich gern diese aufspüren und allesamt löschen.
Natürlich könnte ich gleich alle Symlinks killen, ala:
find . -type l -exec rm {} \;
Aber das würde mir sicherlich Schläge vom Chefe einbringen. Hat jemand
dazu eine creativere Idee?
Viele Grüße,
Andreas
--
Andreas Stallmann - fon: +49 (0) 2241 397198 -3 - fax: -9
dawin gmbh - belgische allee 50 - 53842 troisdorf
hrb 8266 -- amtsgericht siegburg - steuernummer: 220/5793/0373
geschäftsführer: jan dreßler
--
gentoo-user-de@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user-de] Tote Symlinks finden und löschen
2007-07-24 9:49 [gentoo-user-de] Tote Symlinks finden und löschen Andreas Stallmann
@ 2007-07-24 10:00 ` Dirk Heinrichs
2007-07-24 10:13 ` Tobias Hommel
2007-07-24 10:10 ` Hans-Werner Hilse
1 sibling, 1 reply; 4+ messages in thread
From: Dirk Heinrichs @ 2007-07-24 10:00 UTC (permalink / raw
To: gentoo-user-de
[-- Attachment #1: Type: text/plain, Size: 900 bytes --]
Am Dienstag, 24. Juli 2007 schrieb ext Andreas Stallmann:
> Mein Backup spinnt rum, weil leider einige zu sichernde Symlinks ins
> Leere zeigen.
Dann würde ich das Backup-Prog wechseln :-)
> Jetzt würde ich gern diese aufspüren und allesamt löschen.
Für zsh:
# Find (and print) all symbolic links without a target within the current
# dirtree.
$ $ file **/*(D@) | fgrep broken
$ for i in **/*(D@); [[ -f $i || -d $i ]] || echo $i
$ echo **/*(@-^./=%p)
$ print -l **/*(-@)
Quelle: http://grml.org/zsh/zsh-lovers.html
HTH...
Dirk
--
Dirk Heinrichs | Tel: +49 (0)162 234 3408
Configuration Manager | Fax: +49 (0)211 47068 111
Capgemini Deutschland | Mail: dirk.heinrichs@capgemini.com
Wanheimerstraße 68 | Web: http://www.capgemini.com
D-40468 Düsseldorf | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user-de] Tote Symlinks finden und löschen
2007-07-24 9:49 [gentoo-user-de] Tote Symlinks finden und löschen Andreas Stallmann
2007-07-24 10:00 ` Dirk Heinrichs
@ 2007-07-24 10:10 ` Hans-Werner Hilse
1 sibling, 0 replies; 4+ messages in thread
From: Hans-Werner Hilse @ 2007-07-24 10:10 UTC (permalink / raw
To: gentoo-user-de
Hi,
On Tue, 24 Jul 2007 11:49:23 +0200 Andreas Stallmann
<stallmann@dawin.de> wrote:
> Mein Backup spinnt rum, weil leider einige zu sichernde Symlinks ins
> Leere zeigen. Jetzt würde ich gern diese aufspüren und allesamt
> löschen. Natürlich könnte ich gleich alle Symlinks killen, ala:
>
> find . -type l -exec rm {} \;
find -L . -type l -exec rm -f {} \;
----
-L versucht den Symlink aufzulösen, in dem Fall würde "-type l" nicht
ziehen. Also zieht das nur bei Symlinks, die sich nicht auflösen lassen.
-hwh
--
gentoo-user-de@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user-de] Tote Symlinks finden und löschen
2007-07-24 10:00 ` Dirk Heinrichs
@ 2007-07-24 10:13 ` Tobias Hommel
0 siblings, 0 replies; 4+ messages in thread
From: Tobias Hommel @ 2007-07-24 10:13 UTC (permalink / raw
To: gentoo-user-de
Moin,
On Tue, Jul 24, 2007 at 12:00:47PM +0200, Dirk Heinrichs wrote:
> Am Dienstag, 24. Juli 2007 schrieb ext Andreas Stallmann:
>
> > Mein Backup spinnt rum, weil leider einige zu sichernde Symlinks ins
> > Leere zeigen.
>
> Dann würde ich das Backup-Prog wechseln :-)
Ich auch ;)
>
> > Jetzt würde ich gern diese aufspüren und allesamt löschen.
>
> Für zsh:
>
> # Find (and print) all symbolic links without a target within the current
> # dirtree.
> $ $ file **/*(D@) | fgrep broken
> $ for i in **/*(D@); [[ -f $i || -d $i ]] || echo $i
> $ echo **/*(@-^./=%p)
> $ print -l **/*(-@)
>
> Quelle: http://grml.org/zsh/zsh-lovers.html
>
Fuer bash sollte das tun:
for i in $(find -type l -exec file {} \;|grep broken\ symbolic|sed -e 's/\(.*\): broken symbolic link.*/\1/');do echo broken symlink $i;done
> HTH...
>
> Dirk
> --
> Dirk Heinrichs | Tel: +49 (0)162 234 3408
> Configuration Manager | Fax: +49 (0)211 47068 111
> Capgemini Deutschland | Mail: dirk.heinrichs@capgemini.com
> Wanheimerstraße 68 | Web: http://www.capgemini.com
> D-40468 Düsseldorf | ICQ#: 110037733
> GPG Public Key C2E467BB | Keyserver: www.keyserver.net
mfg tobi
--
"Computer are like air conditioners: they stop working when you open windows."
--
gentoo-user-de@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-07-24 10:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-24 9:49 [gentoo-user-de] Tote Symlinks finden und löschen Andreas Stallmann
2007-07-24 10:00 ` Dirk Heinrichs
2007-07-24 10:13 ` Tobias Hommel
2007-07-24 10:10 ` Hans-Werner Hilse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox