Whenever I try to run a grep from the command line it seems like it just hangs and does nothing... even the most basic command returns no results, is there something I'm missing here???
Anyone know what I'm missing??
Thanks,
grep question...
-
- Know my way around
- Posts: 126
- Joined: Sat Dec 03, 2011 7:47 am
grep question...
You do not have the required permissions to view the files attached to this post.
-
- Easy as a breeze
- Posts: 447
- Joined: Mon Nov 19, 2018 1:21 am
Re: grep question...
you're not piping anything into the grep so it's attempting to read from standard in (command line). run some other command and pipe the output into the grep.
-
- New here
- Posts: 3
- Joined: Fri Sep 10, 2021 3:26 am
Re: grep question...
grep takes the input from a origin (pipe, file, direct input, etc...)
i.e.:
(Search the word "things" on all the files recursively from actual folder)
"pipes" the output of ls to the grep command, who only shows the output that contains ".php"
Pipes the contain of the file "things.txt" and shows only the lines that DONT have the "word" on them
Look man or grep --help to find more
Some versions of QNAP don't have a full grep implementation, the ARM one I have don't support "-r" :
i.e.:
Code: Select all
grep -r "things" *
Code: Select all
ls|grep .php
Code: Select all
cat things.txt | grep -v "word"
Look man or grep --help to find more
Some versions of QNAP don't have a full grep implementation, the ARM one I have don't support "-r" :
Code: Select all
[~] # grep -r
grep: invalid option -- 'r'
BusyBox v1.01 (2021.07.25-19:00+0000) multi-call binary
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
-
- Know my way around
- Posts: 126
- Joined: Sat Dec 03, 2011 7:47 am
Re: grep question...
There is no option for -r in this version or what is installed on the QNAP...
I'm trying to find files containing the letter "a"... output to the screen is fine
I'm trying to find files containing the letter "a"... output to the screen is fine
You do not have the required permissions to view the files attached to this post.
-
- Know my way around
- Posts: 126
- Joined: Sat Dec 03, 2011 7:47 am
Re: grep question...
Just following up here... grep in a stripped down version used in my QNAP doesn't appear to have a recursive function... odd.
grep seems to work...
Anyone have any ideas for recursively scanning test in files???
grep seems to work...
Anyone have any ideas for recursively scanning test in files???
You do not have the required permissions to view the files attached to this post.
-
- Know my way around
- Posts: 126
- Joined: Sat Dec 03, 2011 7:47 am
Re: grep question...
Just closing the loop here... egrep is fully functional. I've moved away from grep.
Thanks,
Thanks,