list file contents.
process both file input and directory input