LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-18-2014, 12:39 PM   #1
heronlin
LQ Newbie
 
Registered: Jun 2012
Posts: 14

Rep: Reputation: Disabled
print "ls --color" output to file or printer with colour highlights


Is there a utility to print the output of "ls -go1hX --color" as displayed, i.e. with colour highlights intact?

Googling finds a lot of help for displaying ls output in colour but nothing useful for printing that output.
 
Old 06-18-2014, 12:45 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
I imagine you will have to somehow pipe the command to "something" that will honor the color codes and save it to a printable postscript file. Then you can use 'lp' to print it.

Googled it and found something similar: https://www.linux.com/community/foru...-printer/10967
 
Old 06-18-2014, 01:21 PM   #3
heronlin
LQ Newbie
 
Registered: Jun 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
I imagine that too but what is the "something"?

The vim method fails, prints the esc codes.

I've tried a2pdf but it falls over all the time trying to parse filenames. I thought Kate would have a template for displaying this, which would allow creation of .ps from Kate, but I can't find one.

Thanks for the quick reply.
 
Old 06-18-2014, 01:29 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Seems someone else had to do this,. this is not my idea,. I did a lot of searching to run into this.

https://superuser.com/questions/5736...rallel-printer

Basically, install 'aha' and 'wkhtmltopdf', run the escaped output through them and print it.
 
Old 06-18-2014, 02:19 PM   #5
heronlin
LQ Newbie
 
Registered: Jun 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Thanks, I'm sorry you went through the same search I did. Began to dislike Kate Bush for all the spurious suggested results with 'kate' and 'bash' in them.

I'll have to try again with aha. Couldn't get it working but I'll have another go - hopefully come back here soon and mark it solved.
 
Old 06-18-2014, 02:21 PM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694


I didnt expect such a big wikipedia article about someone that i have never heard of.

Btw: I don't imagine that a screenshot will help? Change the terminal background to white, print screen, print it out? It's a hack, but if you only need this once in a lifetime, for a small text, it might be worth the laziness to do it that way.

Last edited by szboardstretcher; 06-18-2014 at 02:23 PM.
 
Old 06-18-2014, 04:05 PM   #7
heronlin
LQ Newbie
 
Registered: Jun 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
I have used screencaps all my life and never had the need until now to print this kind of output.

aha is working, must have done something stupid at the first aha-git makepkg (arch).

45 pages now loaded into firefox as html, will format and print from there.

Thanks for the help - I would have been running in circles for quite a bit longer without it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "hexinject -s | script_with_gawk > file" won't output anything into "file" Heraton Linux - Newbie 11 02-20-2012 01:26 PM
paper output smaller than "print preview" SaintDanBert Linux - Desktop 2 07-19-2011 09:42 PM
Saving the output of "ls" command in color. smurthygr Linux - Newbie 29 11-30-2010 09:21 AM
printing hh in hh:mm using "awk '{FS=":";print $1}'" misses first line of output!! mayankmehta83 Linux - Newbie 2 12-03-2009 02:55 AM
Printer Configuration: "Print file sent, waiting for printer to finish", JetDirect Ed-MtnBiker Fedora 3 02-23-2007 12:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration