lpr
prints out, what is sent to it via STDIN. So you need to invoke lpr
for each file found by find:
find . -type f ! -name ".*" -print0 | xargs -0 lpr
-type f
searches for files!
is a logical not, hence! -name ".*"
will omit hidden files (with some help from https://superuser.com/a/101012/195224)-print0
separates the individual filesnames with\0
so that this will also work with file names with white spaces in it.xargs
finally executeslpr
with the list of filesnames it receives (-0
again tells that\0
is used as a delimiter).
This command will list only non-dotfiles, but also those in dotdirs.
If you also want to exclude dotdirs, extend the find
command to
find . -type f ! -regex ".*/\..*" ! -name ".*"
And finally, as some versions of lpr
have obviously a problem with empty files, omit these also:
find . -type f ! -regex ".*/\..*" ! -name ".*" ! -empty
As a sidenote: To get a nicer layout of your printout (includes file name) you should consider to replace lpr
by a2ps
.