Saturday 1 July 2017

Linux-6

                                             Commands to know Linux System Information  

à To display System information
uname (short for unix name) is a computer program in Unix and Unix-like computer operating systems that prints the name, version and other details about the current machine and the operating system running on it.
The -a (i.e., all) option tells uname to provide the following information: the name of the kernel, network node host name (e.g., localhost.localdomain), kernel version number and release level (e.g., 2.4.20-6), kernel release date, machine hardware name, CPU (central processing unit) type, hardware platform and operating system name (e.g., GNU/Linux).

[root@server1 ~]# uname -a
Linux server1.abc.com 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Options are available to allow each of these pieces of information to be reported individually: -s for kernel name (i.e., the default action), -n for network node host name, -r for kernel version number and release level, -v for date of release of the kernel version, -m for machine hardware name, -p for CPU type (not available on some systems), -i for general hardware platform and -o for operating system.
àTo Display Kernal information
[root@server1 ~]# uname -r
2.6.32-573.el6.x86_64

àTo Display which version of redhat is installed
[root@server1 ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)

àShows how long system is running+load
[root@server1 ~]# uptime
 08:38:53 up 1 day, 13:06,  1 user,  load average: 0.08, 0.02, 0.01

 A FQDN consists of a short host name and the DNS domain name.You can change the FQDN and the DNS domain name (which is part of the FQDN) in the /etc/hosts file.The FQDN (Fully Qualified Domain Name) of the system is the name that the resolver returns for the host name, such as mysubdomain.example.com. It is usually the hostname followed by the DNS domain name (the part after the first dot). You can check the FQDN using hostname --fqdn or the domain name using dnsdomainname.

You cannot change the FQDN with hostname or dnsdomainname.
àTo display the hostname
[root@server1 ~]# hostname
server1.abc.com

àto display the ip address
[root@server1 ~]# hostname -i
192.168.33.10

àUse the ‘last reboot’ command, which will display all the previous reboot date and time for the system. This picks the information from the /var/log/wtmp file.To display the reboot history
[root@server1 ~]# last reboot
reboot   system boot  2.6.32-573.el6.x Mon Jun 26 15:49 - 08:39 (4+16:49)
reboot   system boot  2.6.32-573.el6.x Mon Jun 26 15:31 - 15:44  (00:12)

àDate command is helpful to display date in several formats. It also allows you to set systems date and time.to display the date
 [root@server1 ~]# date

Sat Jul  1 08:39:23 UTC 2017

No comments:

Post a Comment