say i have a file with the following contents
0x20
0x20
0xc23886
> 0xc12354
> 0xc567555555
i want to delete "> " pattern and keep the rest of the file
say i have a file with the following contents
0x20
0x20
0xc23886
> 0xc12354
> 0xc567555555
i want to delete "> " pattern and keep the rest of the file
You can use sed to trim the unwanted characters.
sed -i 's/^> //' file
# -i overwrite file with new content
# s/^> //' substitute begin of line "^", greaterthan ">", {space} with nothing.
printf '1,$s/^>//\n.\nwq' |ex - myFile
thanks
This is GNU-ism (not that there's anything wrong with that....[(c)Seinfeld])
0xc0a80101
0xc0a80108
0xc0a80129
0x20
0xc0a80201
0xc0a80201
0xc0a80201
0xc0a80201
0xc0a80202
0xc0a80201
0xc0a80202
0xc0a80201
0x20
I want to sort this file.
The command that i am using is sort -u diff1.txt | tee diff1.txt
but diff1.txt is always empty.
what am I doing wrong
you cannot 'tee' to the same file you're sort-ing.
sort -u diff1.txt | tee diff1_sorted.txt