I have a series of log files I'd like to scroll through all at once instead of catting or lessing each one. So I'm thinking:
ls -1tc |xargs -l1 cat |less
This gives a bunch of errors like foo.file not found. So I tried to simplify. (I know logging in as root is generally a Bad Thing.)
Code:
[root@localhost log]# ls -1tc |tee temp
temp
htm/
dptrace-1.txt
dptrace-2.1
dptrace-2.2
dptrace-2.txt
[root@localhost log]# cat temp
temp
htm/
dptrace-1.txt
dptrace-2.1
dptrace-2.2
dptrace-2.txt
[root@localhost log]# vi temp
^[[00m^[[00mtemp^[[00m
^[[00;34mhtm^[[00m/
^[[00mdptrace-1.txt^[[00m
^[[00mdptrace-2.1^[[00m
^[[00mdptrace-2.2^[[00m
^[[00mdptrace-2.txt^[[00m
[2]+ Stopped vi temp
[root@localhost log]# ls -1tc |xargs -l1 cat
cat: temp: No such file or directory
cat: htm/: No such file or directory
cat: dptrace-1.txt: No such file or directory
cat: dptrace-2.1: No such file or directory
cat: dptrace-2.2: No such file or directory
cat: dptrace-2.txt: No such file or directory
So of course cat is failing; the temp file has all these wierd characters. But why does vi show them, and not cat? And why does ls > temp add all those extra characters?
I'm also confused about why the temp file that is just being created shows up during the ls command.
The linux box is RHEL 5.1, but I'm using Putty to ssh in. Putty with XMing is pretty dang useful!