Where are package contents stored for a file, or why aren't they visible w/o right clicking the file

I was wondering about the "Show Package Contents" option in OS X. I have a keynote file that I'm looking at. Exactly where are these contents or its directory stored, because they aren't visible in the Finder window, unless I obviously right click and choose to view them. And I don't think I can find them in the Terminal Application.

Your keynote file is actually a directory, represented by the Finder application as a singe file.

ls -al test.key
total 280
drwxr-xr-x@  5 xbin  xbin     204 May 14 07:17 .<- Note the d in the file mode for the test.key "file"
drwx------+ 23 xbin  xbin    3774 May 14 07:17 .. 
drwxr-xr-x   2 xbin  xbin     102 May 14 07:17 Contents
drwxr-xr-x   2 xbin  xbin     102 May 14 07:17 QuickLook
-rw-r--r--   1 xbin  xbin  140800 May 14 07:17 index.apxl.gz
drwxr-xr-x   2 xbin  xbin     136 May 14 07:17 thumbs

Also, your Keynote file is a designated as a file bundle. Similar to Application bundles, the designation allows the Finder to address the bundle as "the file".

That is my understanding, but I do not warrant this information as suitable for any purpose, including the purpose for which it was created. :wink:

It is technically a folder with files in it, and as noted, the mechanism to view the contents is to right click and "show contents".

The command line can navigate the structure as one would expect navigation of any folder's contents. Navigationally, the command line doesn't really know much about the "bundle" designation. The Finder does.