I would like to convert source code of a few projects to one printable file to save on a usb and print out easily later. How can I do that?
Edit
First off I want to clarify that I only want to print the non-hidden files and directories(so no contents of .git
e.g.).
To get a list of all non-hidden files in non-hidden directories in the current directory you can run the find . -type f ! -regex ".*/\..*" ! -name ".*"
command as seen as the answer in this thread.
As suggested in that same thread I tried making a pdf file of the files by using the command find . -type f ! -regex ".*/\..*" ! -name ".*" ! -empty -print0 | xargs -0 a2ps -1 --delegate no -P pdf
but unfortunately the resulting pdf file is a complete mess.
a2ps -P file *.src
you can produce postscript files out of your source code. But the PS files need to be converted and combined afterwards.a2ps -1 --delegate=0 -l 100 --line-numbers=5 -P pdf
-- I added-l
for 100 chars per row to prevent some word wraps and line numbers, but that's only personal preference.