Check contents and delete resource forks from the command line

Assume we have a file on Mac OS X on a HFS or HFS+ file system named XX.

If you want to see the content of the resource fork for the file do:

cat XX/..namedfork/rsrc

If you want to delete its resource fork:

cat /dev/null >XX/..namedfork/rsrc