File:
O000000667520994000000074720121112000000N^@^@^@
I used the below command but it doesn't work.
grep "^@^@^@" *
|
|
Here I've created a file with a NUL byte in it.† Notice that I use
Grep has trouble finding NULs since they're used to terminate strings in C. Sed, however, can do the job:
† In vi, in insert mode press Ctrl-V, Ctrl-Shift-@ to insert a null byte. |
|||
|
|
|
Character ^@ is the NUL char, so I'm afraid that it cannot be grepped directly. Your best option would be probably to write a simple program that searches for this sequence of bytes. Alternatively you may try to convert it into some form of hexadecimal dump ( |
|||
|
|
|
^@ is the NUL character. What do you want to do with the lines of your files containing it ? You could have a look at Identifying and removing null characters in UNIX which deals with a similar issue. |
|||
|
|
|
In bash you can add special characters when prefixed with
The search string should be read as |
|||||||||||
|