• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
sharadchhetri.com

sharadchhetri.com

Linux,Cloud Computing And DevOps

  • Home
  • Linux
  • CloudComputing
    • Introduction Cloud Computing
    • Amazon AWS
  • Free E-Books
  • About Me

How to find when Operating system was installed in linux CentOS and Red Hat

June 18, 2013 by Sharad Chhetri Leave a Comment

How to find when Operating system was installed in linux CentOS and Red Hat

This is a short video to know how you can find out on which date the linux was installed.
It is applicable to Red Hat based linux distro.

Step 1 : First find out the basesystem rpm.

rpm -qa|grep basesystem

Step 2: Now copy the complete basesystem version no. and hit the below given command .
The output will show many info. See the “Install Date” , this is the date when OS was installed.

rpm -qi 

Note: This is applicable when you have done fresh installation without using any image. For eg. the case is not applicable if you are checking in VPS (Virtual Private Server).

Below given is another method which is sure shot case to case

Another method for finding Install Date of Linux Operating system (CentOS and Red Hat)

Here the logic is Linux OS is installed in / root partition. So we will see when the partition was created which is equivalent to when Linux was installed.

We will use tune2fs command

Step 1: First do “df -Th” to get info where the / is mounted. In below given example / is mounted in /dev/sda5 (In your Linux OS it would vary)

linux@tuxworld:/tmp$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5        28G   25G  1.6G  95% /
udev            2.0G  4.0K  2.0G   1% /dev
tmpfs           796M  980K  795M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            2.0G   12M  2.0G   1% /run/shm
none            100M   56K  100M   1% /run/user
cgroup          2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda7       9.2G  8.9G     0 100% /partition7
/dev/sda8        46G   41G  3.1G  93% /partition8
/dev/sda9        74G   40G   31G  57% /partition9
linux@tuxworld:/tmp$ 

Step 2 : Use the command tune2fs.

tune2fs -l /dev/sda5

The below given is with grep command.

root@tuxworld:~# tune2fs -l /dev/sda5 |grep  'Filesystem created'
Filesystem created:       Sat Feb 18 22:47:25 2012
root@tuxworld:~#

Here “Sat Feb 18 22:47:25 2012” is OS installation date

Do'nt be greedy, share the knowledge!

  • Click to share on Facebook (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)

Related

Filed Under: Linux Tagged With: linux

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow Us

  • Facebook
  • Twitter
  • GitHub
  • YouTube

Recent Posts

  • How to install Java (OpenJDK) on Ubuntu Linux
  • How to install Groovy on Ubuntu 20.04 LTS
  • How to Disable selinux in Red Hat or CentOS
  • How to remove date from WordPress Post URL
  • How to install Mariadb 10.4 server on CentOS 8 / RHEL 8

Top Posts & Pages

  • How to delete mail queue in Postfix
  • How to fix read only USB pen drive in Ubuntu
  • 4 different commands to check the load average in linux
  • How to start / stop / restart / reload iptables on CentOS 7 / RHEL 7
  • How to set hostname and FQDN on CentOS 7 and RHEL 7
  • How to find absolute path of command on Linux / Unix : which command
  • How to create Jenkins user by command line and GUI
  • How to setup Jenkins Credentials for Git repo access
  • How to install MySQL Server 5.6 on CentOS 7 / RHEL 7
  • make command not found in linux CentOS Red Hat ubuntu Debian

DevOps Posts

  • vagrant cloud flow

    Install Vagrant on Ubuntu and create first VM

  • git jenkins credential github

    How to setup Jenkins Credentials for Git repo access

  • terraform

    how to install terraform in Linux : CentOS-Ubuntu

  • docker image

    How to create Ubuntu docker base image

  • Install Ansible on Ubuntu / CentOS / RHEL

Footer

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Sharad Chhetri is an experienced Linux - Cloud Engineer & freelancer. Working on Open Source Technology since RHEL 4.0 (Red Hat Enterprise Linux). He loves sharing the knowledge which earned from real scenarios. Don't be surprised if you find him in technology seminars and meetup groups. You can contact him on email for freelance projects at admin@sharadchhetri.com. Read More…

Tags

Amazon AWS apache automation awk bash script CentOS centos 7 debian devops docker freebsd ftp ghost git grep hostname jenkins kvm linux linux command linux commands MariaDB Server mysql Nagios nginx Octopress owncloud Owncloud 6 php postfix postgres python Red Hat rpm sed selinux ssh swap ubuntu user management vagrant varnish virtualbox vsftp wordpress

Recent Comments

  • Sharad Chhetri on How to install own git server with ssh and http access by using gitolite and gitweb in CentOS
  • Slacker on How to fix read only USB pen drive in Ubuntu
  • Possum on setfacl: Option -m: Invalid argument near character 3
  • UnixNewbie on How to start / stop / restart / reload iptables on CentOS 7 / RHEL 7
  • sop on How to set hostname and FQDN on CentOS 7 and RHEL 7
  • sunil on Managing Jenkins plugins from command line and GUI
  • Corneliu Florea on How to fix read only USB pen drive in Ubuntu
  • Corneliu Florea on How to fix read only USB pen drive in Ubuntu

Copyright © 2009 - 2021 · All Rights Reserved sharadchhetri.com · · Privacy Policy ·
· sitemap.xml · ·The content is copyrighted to sharadchhetri.com and may not be reproduced on other websites without our permission. ·

Copyright © 2021 · Genesis Sample on Genesis Framework · WordPress · Log in