Skip to main content
Question Protected by Archemar
added 68 characters in body
Source Link
user3334375
  • 1.8k
  • 6
  • 17
  • 16

I have a text file:

deiauk 1611516 afsdf 765
minkra 18415151 asdsf 4152
linkra sfsfdsfs sdfss 4555
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4
deiauk 1611516 afsdf ddfgfgd
luktol1 4545 4 9
luktol 1

and I want to match exactly deiauk. When I do this:

grep "deiauk" file.txt

I get this result:

deiauk 1611516 afsdf 765
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4

but I only need this:

deiauk 1611516 afsdf 765
deiauk 1611516 afsdf ddfgfgd

I know there's a -w option, but then my string has to mach whole line.

I have a text file:

deiauk 1611516 afsdf 765
minkra 18415151 asdsf 4152
linkra sfsfdsfs sdfss 4555
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4
luktol1 4545 4 9
luktol 1

and I want to match exactly deiauk. When I do this:

grep "deiauk" file.txt

I get this result:

deiauk 1611516 afsdf 765
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4

but I only need this:

deiauk 1611516 afsdf 765

I know there's a -w option, but then my string has to mach whole line.

I have a text file:

deiauk 1611516 afsdf 765
minkra 18415151 asdsf 4152
linkra sfsfdsfs sdfss 4555
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4
deiauk 1611516 afsdf ddfgfgd
luktol1 4545 4 9
luktol 1

and I want to match exactly deiauk. When I do this:

grep "deiauk" file.txt

I get this result:

deiauk 1611516 afsdf 765
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4

but I only need this:

deiauk 1611516 afsdf 765
deiauk 1611516 afsdf ddfgfgd

I know there's a -w option, but then my string has to mach whole line.

added 14 characters in body; edited title
Source Link
lcd047
  • 7.4k
  • 1
  • 24
  • 33

Mach Match exact string using grep

I have a txttext file:

deiauk 1611516 afsdf 765
minkra 18415151 asdsf 4152
linkra sfsfdsfs sdfss 4555
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4
luktol1 4545 4 9
luktol 1

and I want to machmatch exactly deiauk when. When I do thatthis:

grep "deiauk" file.txt

I gotget this result:

deiauk 1611516 afsdf 765
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4

but I only need this:

deiauk 1611516 afsdf 765

I know that there's a -w option, but then my string havehas to mach whole line.

Mach exact string using grep

I have a txt file

deiauk 1611516 afsdf 765
minkra 18415151 asdsf 4152
linkra sfsfdsfs sdfss 4555
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4
luktol1 4545 4 9
luktol 1

and I want to mach exactly deiauk when I do that

grep "deiauk" file.txt

I got this result

deiauk 1611516 afsdf 765
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4

but I only need this

deiauk 1611516 afsdf 765

I know that there's -w option but then my string have to mach whole line

Match exact string using grep

I have a text file:

deiauk 1611516 afsdf 765
minkra 18415151 asdsf 4152
linkra sfsfdsfs sdfss 4555
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4
luktol1 4545 4 9
luktol 1

and I want to match exactly deiauk. When I do this:

grep "deiauk" file.txt

I get this result:

deiauk 1611516 afsdf 765
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4

but I only need this:

deiauk 1611516 afsdf 765

I know there's a -w option, but then my string has to mach whole line.

Source Link
user3334375
  • 1.8k
  • 6
  • 17
  • 16

Mach exact string using grep

I have a txt file

deiauk 1611516 afsdf 765
minkra 18415151 asdsf 4152
linkra sfsfdsfs sdfss 4555
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4
luktol1 4545 4 9
luktol 1

and I want to mach exactly deiauk when I do that

grep "deiauk" file.txt

I got this result

deiauk 1611516 afsdf 765
deiauk1 sdfsfdsfs 1561 51
deiauk2 115151 5454 4

but I only need this

deiauk 1611516 afsdf 765

I know that there's -w option but then my string have to mach whole line