I don't even know if it is possible. I've been trying to find an answer, and couldn't so I turn to everyone here for help! (In the event that it is possible.)

I know it is possible to save the command output to a text file and I have no issue with that. However, I really love how it comes out in the terminal, all nicely color coded and neatly organized. But it doesn't come out so pretty in a text file and things are harder to find.

To show you all what I was doing:

ls -R /media/ai/WALKMAN/MUSIC

That way I could list all the files that are in the folder as well as the contents of the folders within. (I have inside of all these band folders (within alphabetical folders) are songs. I've got 2000+ and would like a list because I've noticed I have some repeats scattered.)

Everything comes out nice and color coded in the terminal. But when you do:

ls -R /media/ai/WALKMAN/MUSIC > filename.txt

That's just a plain textfile and while things are listed, it is a very long list and very hard to skim through.

So I was wondering if it were possible to have the output saved either in an HTML/XML document or a table so it'd be easier to pilfer through the tremendous list?


Not possible.
The reason is that your shell has settings configured (likely ~/.bashrc) to recognize different commands and outputs and color code accordingly.
Therefore there is no markup to save and no way to do what you would like. What you can do is use a text editor that contains the same type of rules for color coding, recommend emacs.

apt-get install emacs

In terms of saving to another format, you could get infinitely creative here using pipes and redirection, but I do not think this is what you are looking for.

  • Darn! :p Thank you for the response and options, though! But shoot, was seriously hoping that it would be possible. Ah, can't get it all! (would be too easy, yeah?) lol – Souta Jan 31 '13 at 2:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.