Usefull Linux commands

Come visualizzare la versione Linux

Il modo più facile per vedere il nome della distribuzione (e il relativo numero di versione) è abbastanza comune per tutti i tipi di Linux. Aprire un terminale e digitare la stringa seguente:

cat /etc/issue

Il risultato e’ simile a questo:

Ubuntu 14.04.1 LTS

Nel caso dovessi necessitare di ulteriori informazioni, è possibile utilizzare il seguente comando:

cat /etc/*release

Il risultato sarà molto simile a quello della schermata seguente:

[moreno@mbdevnet2 ~]$ cat /etc/*release
CentOS release 6.8 (Final)
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
CentOS release 6.8 (Final)
CentOS release 6.8 (Final)

Come vedere la versione del kernel

La versione della distribuzione è un dato completamente diverso rispetto alla versione del kernel di Linux. Si può facilmente visualizzare il numero di versione aprendo il terminale e digitando il seguente comando:

uname -r

Il risultato e’ :

[moreno@mbdevnet2 ~]$ uname -r
2.6.32-642.15.1.el6.x86_64

The old good top command to find out Linux cpu load

The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel. The top command monitors CPU utilization, process statistics, and memory utilization. The top section contains information related to overall system status – uptime, load average, process counts, CPU status, and utilization statistics for both memory and swap space.

Top command to find out Linux cpu usage

Type the top command:
$ top

Display the utilization of each CPU individually using mpstat

If you are using SMP (Multiple CPU) system, use mpstat command to display the utilization of each CPU individually. It report processors related statistics. For example, type command:
# mpstat
Sample outputs:

[moreno@mbdevnet2 ~]$ mpstat
Linux 2.6.32-642.15.1.el6.x86_64 (mbdevnet2)    10/19/2018      _x86_64_       (4 CPU)

The mpstat command display activities for each available processor, processor 0 being the first one. Global average activities among all processors are also reported. The mpstat command can be used both on SMP and UP machines, but in the latter, only global average activities will be printed.:
# mpstat -P ALL
Sample outputs:

[moreno@mbdevnet2 ~]$ mpstat -P ALL
Linux 2.6.32-642.15.1.el6.x86_64 (mbdevnet2)    10/19/2018      _x86_64_       (4 CPU)
04:58:28 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
04:58:28 PM  all   88.34    0.00    0.03    0.02    0.00    0.01    0.00    0.00   11.59
04:58:28 PM    0   88.35    0.00    0.03    0.00    0.00    0.01    0.00    0.00   11.61
04:58:28 PM    1   88.36    0.00    0.04    0.08    0.00    0.01    0.00    0.00   11.52
04:58:28 PM    2   88.34    0.00    0.03    0.00    0.00    0.01    0.00    0.00   11.63
04:58:28 PM    3   88.33    0.00    0.03    0.00    0.00    0.01    0.00    0.00   11.62

Lascia un commento