Linux Rockz wrote: > I have been using output redirection for quite sometime. I have often > wondered why it is that when I use the 'ls' command, the output is in > several columns on the monitor while it is in a single column when I > redirect the output to a file.
interesting question. :-) Well, it seems that when the output is not a terminal, "ls" will execute "as is". for eg. If you have $ ls > txtfile The txtfile will contain a single column output. However if you try the following: $ ls -C > txtfile you will see that the txtfile now contains columned output. If "ls" detects that standard output is a terminal, then according to the screen width, it columnizes(is this a word?) it. This has nothing to do with redirection, IMHO. It depends on what your standard output is. Try the foll: $ ls --color -C > txtfile $ ls --color > /dev/tty -- arc_of_descent ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ linux-india-help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/linux-india-help
