maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Command Line - How to Tail a File? (https://talk.maemo.org/showthread.php?t=45613)

mail_e36 2010-02-23 21:06

Command Line - How to Tail a File?
 
Folks,

I'm new to Linux and I can't figure out how to tail the dmesg log. "tail dmesg" does not work. I want to do something like "tail /var/log" but I think there is no log on the N900?

I installed the full GNU utilities but still unsure. Please advise

Big Phat Jan 2010-02-23 21:55

Re: Command Line - How to Tail a File?
 
Busybox tail comes on the device and works fine for me.

dmesg is a binary, not a text file so you cannot tail it (well you could but you'd have to use the full path to it, and would just get garbage!). If you just want the last few lines of output that you would get from the dmesg command you could use:

dmesg | tail

You may also want to investigate /var/log/syslog , though I'm not sure whether the logging occurs by default or I've enabled it in the past and forgotten. As this is a "normal" file you could use:

tail /var/log/syslog

to see the last few lines of it.

Cheers,
Jan

Bratag 2010-02-23 21:58

Re: Command Line - How to Tail a File?
 
and lets not forget the ever helpful tail -f for streaming a file.

Big Phat Jan 2010-02-23 22:04

Re: Command Line - How to Tail a File?
 
Quote:

Originally Posted by Bratag (Post 543349)
and lets not forget the ever helpful tail -f for streaming a file.

And how to stop it (Ctrl c)!

Shaichico 2010-02-23 22:05

Re: Command Line - How to Tail a File?
 
Quote:

Originally Posted by Bratag (Post 543349)
and lets not forget the ever helpful tail -f for streaming a file.

Absolutely the best way to tail... not sure if this been tried in maemo but I know it works on most nix with "less" installed and that is shift+F

cpitchford 2010-02-24 11:35

Re: Command Line - How to Tail a File?
 
you'd have to run as root, but

# cat /proc/kmsg
some old data...
...
<6>[45179.402587] slide (GPIO 71) is now open
<6>[45180.745971] slide (GPIO 71) is now closed

that is the same log source from which dmesg gets its content..

mail_e36 2010-02-24 15:09

Re: Command Line - How to Tail a File?
 
Thanks for your response cpitchford, that is what I was looking for!


All times are GMT. The time now is 19:48.

vBulletin® Version 3.8.8