Not sure what's going on, here's one suspicion.
Quote:
Originally Posted by amit_pansuria
when I run If I run 'ls -laF | less', the response is garbled as shown below:
$ ls -laF|less
Code:
<D7><DC><D3><C3><C1><BF> 160
drwxr-xr-x 40 admin pds_system 4096 6<D4><C2> 15 03:12 ./
drwxr-xr-x 9 root root 4096 6<D4><C2> 15 02:12 ../
drwxrwsr-x 2 admin pds_agent 4096 6<D4><C2> 17 19:11 account/
...
|
What did you expect? You make us guess. Maybe this:
Code:
total 160
drwxr-xr-x 40 admin pds_system 4096 2008-06-15 03:12 ./
drwxr-xr-x 9 root root 4096 2008-06-15 02:12 ../
drwxrwsr-x 2 admin pds_agent 4096 2008-05-17 19:11 account/
...
It could be that 'ls' is trying to use colors in the output, and 'less' makes those visible or gets confused? This should get rid of it:
Code:
ls -laF --color=never| less
More hints:
Normally coloring is done with escape sequences, which your xterm (or other terminal) consumes, so you don't see them. To check what exactly 'ls' outputs, try
E.g., I see "^[[01;34m" instead of a change to blue bold text.
man ls
Quote:
By default, color is not used to distinguish types of files. That is
equivalent to using --color=none. Using the --color option without the
optional WHEN argument is equivalent to using --color=always. With
--color=auto, color codes are output only if standard output is con-
nected to a terminal (tty). The environment variable LS_COLORS can
influence the colors, and can be set easily by the dircolors command.
|
You may be using an alias for ls; maybe someone else set it up for you. Check like this:
Code:
$ alias ls
alias ls='ls -FC --color=tty'
My setting (tty) is the same as "auto". In your example, outputting to a pipe (|less) would have turned off coloring.