when use command ls
, the output in terminal looks something like this (with color):
file1 file2 file3
but when save the output to a txt file (ls > output.txt
), in the file it becomes like this:
file1
file2
file3
and also the color is missing. How does ls
implement different output format to different target?
1