LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to find the nineteenth byte and find its original value (https://www.linuxquestions.org/questions/linux-general-1/how-to-find-the-nineteenth-byte-and-find-its-original-value-4175441644/)

lchlebikova 12-16-2012 04:22 AM

How to find the nineteenth byte and find its original value
 
How to find the nineteenth byte? I downloaded a file from the internet (xxx.r) and I need to find the nineteenth byte and then write its original value. It can be any file, just need to find the right command.
Thanx for help!

colucix 12-16-2012 04:33 AM

Hi and welcome to LinuxQuestions!

I wonder what is the purpose of this, anyway you can try the dd command (be careful if you're not experienced with it). For example:
Code:

dd if=xxx.r count=1 ibs=1 skip=18 2>/dev/null
will send the 19th byte to the standard output, so that you can store it in a variable. If you want to redirect it to a file, add the of predicate:
Code:

dd if=xxx.r of=file.out count=1 ibs=1 skip=18 2>/dev/null
Hope this helps.

lchlebikova 12-16-2012 04:36 AM

thank you a lot for your help!


All times are GMT -5. The time now is 04:39 AM.