1

I have been trying to search -1 using grep, but i am unable to find the regex required:

I have already tried:

grep -1
grep "-1"
grep \-1
grep '-1'
grep /-1/

But none of them seem to work. Is there any other way.

Here's what I am seeing:

@DESKTOP-7QNRLTS:~/CS251/CS251-practice/Ass6$ cat raw.txt
-1
2
3
-1
5
-1
7
-1
-1
-1

Time
taken
=
0
seconds
@DESKTOP-7QNRLTS:~/CS251/CS251-practice/Ass6$ cat raw.txt|grep -1
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
@DESKTOP-7QNRLTS:~/CS251/CS251-practice/Ass6$ cat raw.txt|grep "-1"
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
@DESKTOP-7QNRLTS:~/CS251/CS251-practice/Ass6$ cat raw.txt|grep \-1
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
@DESKTOP-7QNRLTS:~/CS251/CS251-practice/Ass6$ cat raw.txt|grep '-1'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
@DESKTOP-7QNRLTS:~/CS251/CS251-practice/Ass6$ cat raw.txt|grep /-1/
@DESKTOP-7QNRLTS:~/CS251/CS251-practice/Ass6$ cat raw.txt|grep 1
-1
-1
-1
-1
-1
-1
Micha Wiedenmann
  • 19,979
  • 21
  • 92
  • 137
Jenil Mewada
  • 575
  • 4
  • 14

0 Answers0