Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
5 years ago the like thread was marked as solved yet can't help me now.
after my desk top switched off on his own I decided to find out what 'syslog' was about maybe it can tell me why it happened.
If you want to read any kind of log, you must pass it to a command for reading text. The ones most often used for this purpose are more and less. I prefer less because it allows you to go backwards as well as forwards.
If you just type "/var/log", the shell will think you want to execute this file as a program. It will try to do that and will fail because text files are not programs and don't have the execute bit set. Not even root can turn a text file into an executable program!
If you want to read any kind of log, you must pass it to a command for reading text. The ones most often used for this purpose are more and less. I prefer less because it allows you to go backwards as well as forwards.
Hmmm. In more, typing a 'b' pages backwards (and '/' can be used to enter a search term, but that only searches forwards)
At least, that's how it works for me.
Hmmm. In more, typing a 'b' pages backwards (and '/' can be used to enter a search term, but that only searches forwards)
At least, that's how it works for me.
Amazing! You learn something every day. I've been using Linux for 20 years now and I didn't know you could go backwards in more. Maybe I ought to read the man page
That, of course, depends on which more your distro/system has installed.
The original Unix (BSD) more could only go forward (show "more" of the file).
That's why the less and most commands were written.
From the man page for the more from "util-linux" (a GNU package):
Quote:
This version is especially primitive. Users should realize that less(1) provides more(1) emulation plus extensive enhancements.
This version does provides the 'b' or 'ctrl-B' commands, though.
Last edited by ehartman; 03-05-2020 at 01:51 PM.
Reason: show control B alternative
If you want to read any kind of log, you must pass it to a command for reading text. The ones most often used for this purpose are more and less. I prefer less because it allows you to go backwards as well as forwards.
If you just type "/var/log", the shell will think you want to execute this file as a program. It will try to do that and will fail because text files are not programs and don't have the execute bit set. Not even root can turn a text file into an executable program!
dear hazel
it was the first time ever I tried to look so deep under the hood and a couple of blogs/tutorials never mentioned '/var/log'
to be used as argument to 'less' or 'more' I wasn't overly tired and emotional to miss such a point.
Anyway, the problem mentioned in the thread heading is solved and you're my hero today.
yours`
sehrguey
seog, I'm sorry we haven't made this clear...
To see what's in /var/log/syslog, you need to
Code:
more /var/log/syslog
#or
less /var/log/syslog
Let us know what you see there about your "desktop switching off"
dear scasey,
the answers to this thread participants made me think
Code:
less /var/log/syslog
was more preferable.
With the 'switching off' being somewhat off the subject I marked the thread as solved.
Now, by 'switching off' I mean being thrown out of the current session or even sudden complete inexplicable power off of the desk top that sometimes happens and exasperates me. Sadly, /var/log/syslog didn't make me any wiser, I fell into an ocean of messages I couldn't understand.
Thank you for asking.
yours`
sehrguey
Sadly, /var/log/syslog didn't make me any wiser, I fell into an ocean of messages I couldn't understand.
If syslog does contain any useful information (and that is by no means certain; it's just the obvious place to start looking), then it will be at the end of the session that crashed. So when you next boot, look for the first entry that contains the current date and time. You can do that within either more or less by entering a / and then the string you are looking for. For example /Mar 7 14:03. Note the spacing: the day of the month occupies two columns. The immediately preceding lines will be the end of the last session. Possibly those lines will be of some use.
Depending on your distro, /var/log/ may also contain a separate kernel log (often called kern.log) and/or a combined messages file. All of these can be quickly checked in the same way. Look for messages that are actually flagged up as errors or warnings.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.