How do I find the last logged system boot and shutdown times?
I'm a Rails developer working on a web application on Ubuntu Server 10.04. Due to internal requirements, I was asked to find the last 10 system boot and shutdown times... I have no clue where to find these details. Could someone help me out?
boot shutdown logging events
add a comment |
I'm a Rails developer working on a web application on Ubuntu Server 10.04. Due to internal requirements, I was asked to find the last 10 system boot and shutdown times... I have no clue where to find these details. Could someone help me out?
boot shutdown logging events
add a comment |
I'm a Rails developer working on a web application on Ubuntu Server 10.04. Due to internal requirements, I was asked to find the last 10 system boot and shutdown times... I have no clue where to find these details. Could someone help me out?
boot shutdown logging events
I'm a Rails developer working on a web application on Ubuntu Server 10.04. Due to internal requirements, I was asked to find the last 10 system boot and shutdown times... I have no clue where to find these details. Could someone help me out?
boot shutdown logging events
boot shutdown logging events
edited Jan 28 '12 at 4:16
Jjed
10.7k65989
10.7k65989
asked Apr 26 '11 at 15:55
Selvakumar
131123
131123
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Use the last
command.
last -x | grep shutdown
last -x | grep reboot
You can pipe this to the head
to read the last n instances. For example, in your case:
last -x | grep shutdown | head -n 10
You also should set
BOOTLOGD_ENABLE=Yes
in the /etc/default/bootlogd
file (it could be No by default).
great answer, I add | tail -10
– enzotib
Apr 26 '11 at 19:05
I have no/etc/default/bootlogd
on my Ubuntu 16.04.2
– Vadim Kotov
Oct 24 '17 at 14:58
More on how to enable bootlogd, which is not necessary as of Debian Wheezy (i.e. as of Ubuntu 11.10 -- or so seems likely).
– AndyP
Feb 17 at 0:24
add a comment |
For a GUI method you can use hardinfo
as described here: Does Ubuntu have a "device manager" equivalent? And what is an easy way to access USB drives?.
Under the section Boots
you will see this:
Installation is straight forward using:
sudo apt install hardinfo
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f37132%2fhow-do-i-find-the-last-logged-system-boot-and-shutdown-times%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use the last
command.
last -x | grep shutdown
last -x | grep reboot
You can pipe this to the head
to read the last n instances. For example, in your case:
last -x | grep shutdown | head -n 10
You also should set
BOOTLOGD_ENABLE=Yes
in the /etc/default/bootlogd
file (it could be No by default).
great answer, I add | tail -10
– enzotib
Apr 26 '11 at 19:05
I have no/etc/default/bootlogd
on my Ubuntu 16.04.2
– Vadim Kotov
Oct 24 '17 at 14:58
More on how to enable bootlogd, which is not necessary as of Debian Wheezy (i.e. as of Ubuntu 11.10 -- or so seems likely).
– AndyP
Feb 17 at 0:24
add a comment |
Use the last
command.
last -x | grep shutdown
last -x | grep reboot
You can pipe this to the head
to read the last n instances. For example, in your case:
last -x | grep shutdown | head -n 10
You also should set
BOOTLOGD_ENABLE=Yes
in the /etc/default/bootlogd
file (it could be No by default).
great answer, I add | tail -10
– enzotib
Apr 26 '11 at 19:05
I have no/etc/default/bootlogd
on my Ubuntu 16.04.2
– Vadim Kotov
Oct 24 '17 at 14:58
More on how to enable bootlogd, which is not necessary as of Debian Wheezy (i.e. as of Ubuntu 11.10 -- or so seems likely).
– AndyP
Feb 17 at 0:24
add a comment |
Use the last
command.
last -x | grep shutdown
last -x | grep reboot
You can pipe this to the head
to read the last n instances. For example, in your case:
last -x | grep shutdown | head -n 10
You also should set
BOOTLOGD_ENABLE=Yes
in the /etc/default/bootlogd
file (it could be No by default).
Use the last
command.
last -x | grep shutdown
last -x | grep reboot
You can pipe this to the head
to read the last n instances. For example, in your case:
last -x | grep shutdown | head -n 10
You also should set
BOOTLOGD_ENABLE=Yes
in the /etc/default/bootlogd
file (it could be No by default).
edited Jul 6 '17 at 10:46
muru
1
1
answered Apr 26 '11 at 18:13
wojox
7,57612955
7,57612955
great answer, I add | tail -10
– enzotib
Apr 26 '11 at 19:05
I have no/etc/default/bootlogd
on my Ubuntu 16.04.2
– Vadim Kotov
Oct 24 '17 at 14:58
More on how to enable bootlogd, which is not necessary as of Debian Wheezy (i.e. as of Ubuntu 11.10 -- or so seems likely).
– AndyP
Feb 17 at 0:24
add a comment |
great answer, I add | tail -10
– enzotib
Apr 26 '11 at 19:05
I have no/etc/default/bootlogd
on my Ubuntu 16.04.2
– Vadim Kotov
Oct 24 '17 at 14:58
More on how to enable bootlogd, which is not necessary as of Debian Wheezy (i.e. as of Ubuntu 11.10 -- or so seems likely).
– AndyP
Feb 17 at 0:24
great answer, I add | tail -10
– enzotib
Apr 26 '11 at 19:05
great answer, I add | tail -10
– enzotib
Apr 26 '11 at 19:05
I have no
/etc/default/bootlogd
on my Ubuntu 16.04.2– Vadim Kotov
Oct 24 '17 at 14:58
I have no
/etc/default/bootlogd
on my Ubuntu 16.04.2– Vadim Kotov
Oct 24 '17 at 14:58
More on how to enable bootlogd, which is not necessary as of Debian Wheezy (i.e. as of Ubuntu 11.10 -- or so seems likely).
– AndyP
Feb 17 at 0:24
More on how to enable bootlogd, which is not necessary as of Debian Wheezy (i.e. as of Ubuntu 11.10 -- or so seems likely).
– AndyP
Feb 17 at 0:24
add a comment |
For a GUI method you can use hardinfo
as described here: Does Ubuntu have a "device manager" equivalent? And what is an easy way to access USB drives?.
Under the section Boots
you will see this:
Installation is straight forward using:
sudo apt install hardinfo
add a comment |
For a GUI method you can use hardinfo
as described here: Does Ubuntu have a "device manager" equivalent? And what is an easy way to access USB drives?.
Under the section Boots
you will see this:
Installation is straight forward using:
sudo apt install hardinfo
add a comment |
For a GUI method you can use hardinfo
as described here: Does Ubuntu have a "device manager" equivalent? And what is an easy way to access USB drives?.
Under the section Boots
you will see this:
Installation is straight forward using:
sudo apt install hardinfo
For a GUI method you can use hardinfo
as described here: Does Ubuntu have a "device manager" equivalent? And what is an easy way to access USB drives?.
Under the section Boots
you will see this:
Installation is straight forward using:
sudo apt install hardinfo
answered 2 days ago
WinEunuuchs2Unix
43.2k1075163
43.2k1075163
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f37132%2fhow-do-i-find-the-last-logged-system-boot-and-shutdown-times%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown