How to check which Redhat version is installed on the server

To know the current Redhat version installed on the server we need to execute the below command:

  1. cat /etc/redhat-release
  2. uname -a

redhaterelease

redhatrelease1

In the above example we can see that the current RHEL Version is el7 [i.e Enterprise Linux  7].

Advertisements

Uses of ‘uptime’ command

One of the most important use of uptime command is to find out how long the system has been running.

The output of the uptime command displays information about the following:

  1. The current time.
  2. How long the server has been running.
  3. of users logged in.
  4. The load average.

uptime1

Breakdown of the output:

  1. Current time: 10:42:58
  2. Uptime: 30 minutes
  3. of users logged in: 2
  4. Load average of the system: 0.25, 0.13, 0.28

 

The -s option [–since] with uptime displays how long the system has been up in ” yyyy-mm-dd HH:MM:SS” format.

uptime2

 

 

Uses of ‘cat’ command

cat command is one of the most frequently used command in Linux. It is used to read the contents of the file and print on the standard output i.e. the terminal. Other uses of cat commands are to create new files, combine files and copy files.

Syntax:

cat [option]… [file]…

Here are some ways we can use the cat command:

  1. Create a new file. It can create empty file as well. It is also used to read the contents of the file.
    cat1
  2. Read multiple files at the same time.cat2
  3. Concatenate multiple files into a new file.cat3
  4. Copy contents from on file to another. If the file already exists then it will overwrite the file. If the file doesn’t exist, then a new file will be created.cat4
  5. Append the contents of one file to another. You can append the contents of multiple file as well.cat6cat5

Various parameters can be used with cat command:

  1. -n: number all output lines.
  2. -b: numbers nonempty output lines.
  3. -e: displays $ at the end of each line.cat7
  4. -s: suppress repeated empty output lines.cat8