Pythontr

husonet | Tarih: 02.03.2015

Linux konsol üzerinden hex dosya açma

Linux konsol ortamında her hangi bir dosyayı hızlıca hex olarak incelenmesi

Method 1 od konsol komutu üzerinden örnek çıktı
od -xc /home/pythontr/file/xxxx.msg | less
0001320 2f35 5a49 2f4d 4f54 474c 5441 4755 4148
5 / I Z M / T O L G A T U G H A
0001340 0d4e 520a 4645 2f2f 412f 5249 542f 4c4f
N

R E F / / / A I R / T O L

Method 2 xxd konsol komutu kullanarak örnek çıktı
xxd /home/pythontr/file/xxxx.msg | less
0000210: 2f31 0d0a 2f32 2f4e 442f 2f43 4d54 3430 /1../2/ND//CMT40
0000220: 2d35 392d 3330 2f33 3020 4352 5f4c 0d0a -59-30/30 CR_L..

vim set komutu
:%!xxd
yada
:%!xxd -r
vim editörü için ayarlama
vim /home/pythontr/.vimrc
augroup Binary
au!
au BufReadPre *.msg let &bin=1
au BufReadPost *.msg if &bin | %!xxd
au BufReadPost *.msg set ft=xxd | endif
au BufWritePre *.msg if &bin | %!xxd -r
au BufWritePre *.msg endif
au BufWritePost *.msg if &bin | %!xxd
au BufWritePost *.msg set nomod | endif
augroup END