0

When I run each command, I get the following output:

root@ubuntu:~# hd test.txt 
00000000  31 32 33 34 35 36 0a                              |123456.|
00000007
root@ubuntu:~# hexdump test.txt 
0000000 3231 3433 3635 000a                    
0000007

But both commands are looking at the same location on the disk:

root@ubuntu:~# which hd
/usr/bin/hd
root@ubuntu:~# ls -l /usr/bin/hd 
lrwxrwxrwx 1 root root 7 Jul  6 03:13 /usr/bin/hd -> hexdump

Can anyone tell me why the results I get are different from each other?

Randomhero
  • 1,543

1 Answers1

1

This is closely related to this answer on Unix and Linux.

"hd is a synonym for hexdump -C"

They are very similar, but you are actually calling very slightly different things with each command.

Randomhero
  • 1,543