Search This Blog

Friday 5 May 2017

How to get OS Version and other server related deails in Linux

 After opening a command or Putty terminal in Linux Try with the following commands to know the details.


1. To know the OS Version Details:

[pcs_user@root]$ cat /etc/os-release


Output:
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

2.  lsb_release command 
There is a lsb_release gives LSB(Linux Standard Base) and distribution specific info. on the CLI.

[pcs_user@root]$ lsb_release -a


Output:
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.6.1810 (Core)
Release:        7.6.1810
Codename:       Core

3. hostnamectl command

Use hostnamectl command to query and change the system hostname and related settings. Just type the following command to check OS name and Linux kernel version:

[pcs_user@root]$ hostnamectl

Output:
   Static hostname: DevServer.BI.Oracle.com
         Icon name: computer-vm
           Chassis: vm
        Machine ID: b30d0f2110a0c19ede3ce23488f
           Boot ID: b7b17e68ac544a72340dfafec4ba
    Virtualization: kvm
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-957.1.3.el7.x86_64
      Architecture: x86-64


4. To Know the Kernel version
[pcs_user@root]$ uname -r


Output:
3.10.0-957.1.3.el7.x86_64

Cheers!
Bose

Wednesday 3 May 2017

How To create a Swap file in Linux

Once you connected to Linux terminal or putty, with the following steps we can create a swap file.

We need to have the root or sudo privileges to do the same.

To add a swap file:
  1. Determine the size of the new swap file in megabytes and multiply by 1024 to determine the number of blocks. For example, the block size of a 64 MB swap file is 65536. (64*1024)
          Mention appropriate count to get correct size of your swap file.
  1. At a shell prompt as root, type the following command with count being equal to the desired block size:
dd if=/dev/zero of=/swapfile bs=1024 count=65536
  1. Change the permissions of the newly created file:
chmod 0600 /swapfile
  1. Setup the swap file with the command:
mkswap /swapfile
  1. To enable the swap file immediately but not automatically at boot time:
swapon /swapfile
  1. To enable it at boot time, edit /etc/fstab to include the following entry:
/swapfile          swap            swap    defaults        0 0
The next time the system boots, it enables the new swap file.

Cheers!
Bose

What is Oracle Database Link and How to create database link (DB Link)

 https://www.oracletutorial.com/oracle-administration/oracle-create-database-link/

Recent Posts