Dateien aus mehreren Verzeichnissen in einen Ordner kopieren
Hy, ich habe ein kleines Kopierproblem. Leider konnte ich in den Manuals und im Archiv nix finden. Sollte ich etwas übersehen haben, wäre ich für einen Fingerzeig dankbar. Folgende Situation: /dir/a/1.txt /dir/a/2.txt /dir/a/b/3.txt /dir/c/4.txt usw. nun möchte ich sämtliche Dateien in ein Ordner kopieren, so dass sie danach auf der selben ebene liegen. /zieldir/1.txt /zieldir/2.txt /zieldir/3.txt ... Ich hatte an etwas wie find | cp /zieldir gedacht, aber cp akzeptiert wohl kein pipe als source. Vielen Dank im Vorraus Pete
Hi Pete On Sun, Sep 16, 2001 at 12:37:27PM +0200, Pete 'Baldur' Hillebrand wrote:
ich habe ein kleines Kopierproblem. Leider konnte ich in den Manuals und im Archiv nix finden. Sollte ich etwas übersehen haben, wäre ich für einen Fingerzeig dankbar.
Folgende Situation:
/dir/a/1.txt /dir/a/2.txt /dir/a/b/3.txt /dir/c/4.txt usw.
nun möchte ich sämtliche Dateien in ein Ordner kopieren, so dass sie danach auf der selben ebene liegen. /zieldir/1.txt /zieldir/2.txt /zieldir/3.txt ...
Ich hatte an etwas wie find | cp /zieldir gedacht, aber cp akzeptiert wohl kein pipe als source.
man find find . -name "*.txt" -type f -exec cp {} /zieldir/ \; -- MfG. Falk
Hallo, Baldur@4players.de ("Pete 'Baldur' Hillebrand") writes:
Hy,
ich habe ein kleines Kopierproblem. Leider konnte ich in den Manuals und im Archiv nix finden. Sollte ich etwas übersehen haben, wäre ich für einen Fingerzeig dankbar.
Folgende Situation:
/dir/a/1.txt /dir/a/2.txt /dir/a/b/3.txt /dir/c/4.txt usw.
nun möchte ich sämtliche Dateien in ein Ordner kopieren, so dass sie danach auf der selben ebene liegen. /zieldir/1.txt [...]
Da hilft vielleicht /usr/bin/mmv (multiple move), sieh auch man (1) mmv. -Dieter -- Dieter Kluenter Brute Force Imaging
participants (3)
-
Dieter Kluenter
-
Falk Sauer
-
Pete 'Baldur' Hillebrand