Fileinhalt suchen: Unterschied zwischen den Versionen

Aus Primatenwiki
Zur Navigation springen Zur Suche springen
Die Seite wurde neu angelegt: «find / -type f -name "*.txt" | xargs grep "was" = Files mit bestimmtem Inhalt verschieben = #!/bin/bash # call this script with <script.sh> "<serachstring>" <searchdir> <movedir> grep -lri "$1" $2 | while read -r line ; do echo "Processing $line" cp -p $line $3 done»
 
(kein Unterschied)

Aktuelle Version vom 8. Januar 2025, 16:16 Uhr

find / -type f -name "*.txt" | xargs grep "was"


Files mit bestimmtem Inhalt verschieben

#!/bin/bash

# call this script with <script.sh> "<serachstring>" <searchdir> <movedir>

grep -lri "$1" $2 | while read -r line ; do
    echo "Processing $line"
    cp -p $line $3
done