Hi all,
wollte auf meinem NAS vom Terminl aus grep -ri / "text" aufrufen um was zu suchen, habe aber nur die Hilfe erhalten, die mir sagt, daß es KEIN -r gibt.
Was ist das für ein grep? Was ist das für ein Linux?
Danke Charly
Hi all,
wollte auf meinem NAS vom Terminl aus grep -ri / "text" aufrufen um was zu suchen, habe aber nur die Hilfe erhalten, die mir sagt, daß es KEIN -r gibt.
Was ist das für ein grep? Was ist das für ein Linux?
Danke Charly
Das ist eine Busybox, und bei mir gibt es die Option -r:
[~] # grep
BusyBox v1.24.1 (2019-04-23 13:14:40 CST) multi-call binary.
Usage: grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...
Search for PATTERN in FILEs (or stdin)
-H Add 'filename:' prefix
-h Do not add 'filename:' prefix
-n Add 'line_no:' prefix
-l Show only names of files that match
-L Show only names of files that don't match
-c Show only count of matching lines
-o Show only the matching part of line
-q Quiet. Return 0 if PATTERN is found, 1 otherwise
-v Select non-matching lines
-s Suppress open and read errors
-r Recurse
-i Ignore case
-w Match whole words only
-x Match whole lines only
-F PATTERN is a literal (not regexp)
-E PATTERN is an extended regexp
-m N Match up to N times per file
-A N Print N lines of trailing context
-B N Print N lines of leading context
-C N Same as '-A N -B N'
-e PTRN Pattern to match
-f FILE Read pattern from file
Alles anzeigen
Gruss
Ich sehe bei mir
[~] # [~] # grep --version
grep: unrecognized option '--version'
BusyBox v1.01 (2020.09.28-18:40+0000) multi-call binary
Usage: grep [-ihHnqvs] PATTERN [FILEs...]
Search for PATTERN in each FILE or standard input.
Options:
-H prefix output lines with filename where match was found
-h suppress the prefixing filename on output
-i ignore case distinctions
-l list names of files that match
-n print line number with output lines
-q be quiet. Returns 0 if result was found, 1 otherwise
-v select non-matching lines
-s suppress file open/read error messages
Alles anzeigen
Dann hab ich wohl Pech gehabt und muss anders suchen.
Danke für Deine Info
Interessant: neuere Busybox, weniger Optionen.
Vielleicht wäre es hilfreich, wenn Du Dein FW Version angibst. Bei mir ist es die v4.3.4.xxx, gibt bei dem OEM keine aktuellere FW .
Gruss
Über Entware lässt sich das "normale" grep und find nachinstallieren.
Mod: Unnötiges Volltext-/Direktzitat entfernt! Forenregeln und Die Zitat Funktion des Forums richtig nutzen
Was die Versionsnummer angeht, hast Du Recht, das machte mich auch stutzig.
Aber schau mal auf das Build-Datum:
BusyBox v1.24.1 (2019-04-23 13:14:40 CST) multi-call binary.
BusyBox v1.01 (2020.09.28-18:40+0000) multi-call binary
Gruss
Hm.Komisch.
Komischer finde ich dass v1.01 eigentlich aus 2005 ist und die 1.24.1 aus 2015.
Da wird demnach immernoch dran rumgeschraubt oder wo kommt das Datum her?
Danke für das nicht beachten der Forenregeln (Inlinecode/Codeblocks) und die Mehrarbeit die mir dadurch entsteht.
Zum Thema:
Das Datum ist die Kompilierungszeit.
Was die Unterschiede zwischen den NAS betrifft, das eine ist ein ARM und das andere ein X86 HAL-NAS.
BusyBox und die enthaltenen Befehle sind an die Bedürfnisse stark anpassbar. Je weniger Speicher zur Verfügung steht, um so mehr wird abgespeckt.