02-27-2010
2,288,
480
Join Date: Apr 2007
Last Activity: 3 May 2020, 8:28 AM EDT
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
Of the systems on which I tried to use od with a directory, Solaris 10 failed, but (some versions of) IBM AIX, and HP-UX succeeded.
The K & R book was written a long time ago, before Linux was created. I do not know why Linux restricts commands like cat and od from dealing with directories.
The chmod behavior might be explained by the setting of your umask. See man umask for details ... cheers, drl