System Information Linux Commands

System information Linux commands are commands that are used to gather information about the system, such as its hardware components, memory usage, disk space utilization, etc.


Here are some common Linux commands used to gather system information:

uname

The uname command is used to display information about the Linux operating system and its underlying system information, including the name, version, and architecture.

Here's the basic syntax of the uname command:

uname [OPTION]...

Where [OPTION] is one or more of the following options:

  • -a: Display all information about the system, including the name, version, release, and machine architecture.
  • -m: Display the machine hardware name.
  • -n: Display the hostname of the system.
  • -r: Display the Linux kernel release version.
  • -s: Display the name of the operating system.
  • -p: Display the processor type.
  • -v: Display the Linux kernel version.


Example usage:

Calling uname without any options will return the Operating System codename:

username@Technoscience:~$ uname
Linux
username@Technoscience:~$

To display all information about the system, including the name, version, release, and machine architecture.

username@Technoscience:~$ uname -a
Linux Technoscience 4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
username@Technoscience:~$

To display the machine hardware name, e.g. x86_64 for a 64-bit system.

username@Technoscience:~$ uname -m
x86_64
username@Technoscience:~$

To display the hostname of the system.

username@Technoscience:~$ uname -n
Technoscience
username@Technoscience:~$


lsb_release

The lsb_release command is used to display information about the Linux distribution and its version.

Here's the basic syntax of the lsb_release command:

lsb_release [OPTION]...

Where [OPTION] is one or more of the following options:

  • -a: Display all information about the distribution, including the name, description, and release version.
  • -d: Display the description of the distribution.
  • -i: Display the distribution ID.
  • -r: Display the release version of the distribution.
  • -s: Display a short description of the distribution.


Example usage:

To display all information about the distribution, including the name, description, and release version.

username@Technoscience:~$ lsb_release -a
No LSB modules are available.
Distributor ID:Ubuntu
Description: Bodhi Linux
Release: 18.04
Codename: bionic
username@Technoscience:~$
This command displays the description of the distribution:

username@Technoscience:~$ lsb_release -d
Description: Bodhi Linux
username@Technoscience:~$

This command displays a short description of the distribution:

username@Technoscience:~$ lsb_release -s
No LSB modules are available.
username@Technoscience:~$


cat /proc/version

The /proc/version file is a virtual file in the /proc file system that provides information about the Linux kernel version that is running on the system. The cat command can be used to display the contents of this file.

The output of the cat /proc/version displays the following information:

  • The Linux version string, which includes the Linux kernel version and the name of the distribution that is running the kernel.
  • The build time and date of the Linux kernel.
  • The name and email address of the person who built the Linux kernel.

Example usage:

To display the information about the Linux kernel version and builds information use the following command:

username@Technoscience:~$ cat /proc/version
Linux version 4.15.0-88-generic (buildd@lgw01-amd64-036) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020
username@Technoscience:~$

In this example, the Linux kernel version is 4.15.0-88-generic, and the distribution that is running the kernel is Ubuntu 18.04.1.


cat /proc/cpuinfo 

The /proc/cpuinfo file is a virtual file in the /proc file system that provides information about the central processing unit (CPU) in the system. The cat command can be used to display the contents of this file.

The output of cat /proc/cpuinfo displays information about each processor in the system, including:
  • Processor vendor and model name.
  • Processor clock speed.
  • Cache size.
  • Processor flags, which represent features that the processor supports.

Example usage:

This command displays information about the central processing unit (CPU) in the system.

Here's a sample output of cat /proc/cpuinfo:

username@Technoscience:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model         : 69
model name : Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
stepping : 1
cpu MHz : 2494.228
cache size : 3072 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid         : 0
initial apicid : 0
fpu         : yes
fpu_exception : yes
cpuid level : 13
wp         : yes
flags         : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase bmi1 avx2 bmi2 invpcid md_clear flush_l1d
bugs         : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 4988.45
clflush size : 64
cache_alignment: 64
address sizes : 39 bits physical, 48 bits virtual
power management:

username@Technoscience:~$

In this example, the system has an Intel core i5 4th Gen processor. The processor clock speed is 1.90 GHz and the cache size is 3072 KB.


cat /proc/meminfo 

The /proc/meminfo file is a virtual file in the /proc file system that provides information about the memory usage and statistics of the system. The cat command can be used to display the contents of this file.

The output of cat /proc/meminfo displays information about the system's memory usage, including:

  • Total installed memory (MemTotal).
  • Free memory is available (MemFree).
  • Buffered memory is used by the kernel (Buffers).
  • Cached memory is used by the kernel (Cached).
  • Total swap space (SwapTotal).
  • Free swap space (SwapFree).


Example usage:

To display the information about the memory usage and statistics of the system. Here's a sample output of cat /proc/meminfo:

username@Technoscience:~$ cat /proc/meminfo
MemTotal:        1511588 kB
MemFree:          439024 kB
MemAvailable:    1139848 kB
Buffers:           91660 kB
Cached:           699344 kB
SwapCached:            0 kB
Active:           435760 kB
Inactive:         481672 kB
Active(anon):     127208 kB
Inactive(anon):     2564 kB
Active(file):     308552 kB
Inactive(file):   479108 kB
Unevictable:          32 kB
Mlocked:              32 kB
SwapTotal:       1535360 kB
SwapFree:        1535360 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:        126480 kB
Mapped:           126816 kB
Shmem:              3348 kB
Slab:             101160 kB
SReclaimable:      84968 kB
SUnreclaim:        16192 kB
KernelStack:        3084 kB
PageTables:        10960 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2291152 kB
Committed_AS:     916248 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       80832 kB
DirectMap2M:     1478656 kB
username@Technoscience:~$

In this example, the system has a total of  1511588 KB of memory, with 439024 KB of free memory available. The system also has a total of 1139848 KB of swap space, with 699344 KB of cache space.


df 

The df command is used to display information about disk space usage on a file system.

By default, df displays the disk space usage information for all mounted file systems in the system. Each file system is displayed on a separate line, with columns indicating the following information:
  • Filesystem: the type of file system.
  • 1K-blocks: the total size of the file system in 1KB blocks.
  • Used: the amount of disk space used by the file system.
  • Available: the amount of disk space available on the file system.
  • Use%: the percentage of disk space used.
  • Mounted on: the mount point of the file system.

Example usage:

This command displays the disk space usage information for all mounted file systems in the system. Here's a sample output of df:

username@Technoscience:~$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              722484       0    722484   0% /dev
tmpfs             151160    1000    150160   1% /run
/dev/sda1       32426780 4743504  26013032  16% /
tmpfs             755792       0    755792   0% /dev/shm
tmpfs               5120       4      5116   1% /run/lock
tmpfs             755792       0    755792   0% /sys/fs/cgroup
tmpfs             151156       8    151148   1% /run/user/1000
username@Technoscience:~$

In this example, the system has two file systems, /dev/sda1 and /dev/sdb1, mounted at the root directory (/) and the /data directory, respectively.


free

The free command is used to display information about the total amount of physical memory and swap memory available, as well as the amount of memory being used and the amount of memory available for processes to allocate.

By default, free displays information in a table format, with columns indicating the following information:

  • total: the total amount of physical memory or swap memory available.
  • used: the amount of physical memory or swap memory being used.
  • free: the amount of physical memory or swap memory available for processes to allocate.
  • shared: the amount of physical memory shared between processes.
  • buffers: the amount of physical memory used as buffers.
  • cache: the amount of physical memory used as a cache.
  • available: the amount of physical memory available to allocate to running processes, taking into account cache and buffers.

Example usage:

This command displays the information about the total amount of physical memory and swap memory available, as well as the amount of memory being used and the amount of memory available for processes to allocate. Here's a sample output for free:

username@Technoscience:~$ free
              total        used        free      shared  buff/cache   available
Mem:        1511588      197620      437308        3368      876660     1138800
Swap:       1535360           0     1535360
username@Technoscience:~$

In this example, the system has 1511588 KB of physical memory, and 1535360 KB of swap memory. Of the physical memory, 197620 KB is being used, 0 is free, 3368 KB is shared, and 876660 KB is used as buffers/cache. The available column shows 1138800 KB of physical memory available to allocate to running processes, taking into account cache and buffers.


top

The top command is used to display the processes currently running on a Linux system, and information about the system resources being used. It is a dynamic, real-time view of the system's processes and resource usage.

By default, the top displays information about the following:

  • Current system uptime.
  • The number of users logged into the system.
  • Load average: an indicator of system activity, represented by three values representing the average number of system processes over the past 1, 5, and 15 minutes.
  • The total number of tasks (processes) running and the number of tasks in each process state (running, sleeping, stopped, etc.).
  • Physical memory usage and swap memory usage.
  • The list of processes is sorted by CPU usage. For each process, the top displays the following information:
    • Process ID (PID).
    • The user running the process.
    • CPU usage percentage.
    • Memory usage.
    • Command name.


Example usage:

To display the real-time view of the processes running on the system and information about the system resources being used.

username@Technoscience:~$ top

Here's a sample output of the top:

In this example, the system has been up for 3:25 minutes. The load average is 0.10, 0.05, and 0.01 for the past 1, 5, and 15 minutes, respectively. There are 110 tasks running, with 1 task running and 77 tasks sleeping. 99.5% of the CPU is idle. The system has 1511588 KB of physical memory and 1535360 KB of swap memory. The first process listed, with PID 819, is using 0.3% of the CPU and 3.2% of the memory, and has been running for 0:24:15. The second process listed, with PID 1, is using 0.0% of the CPU and 0.6% of the memory, and has been running for 0:01:27.


htop

'htop' is a system monitoring tool for Linux that provides a real-time, interactive overview of the processes running on a system. It provides information on the system's performance, including CPU usage, memory usage, and other statistics. Here are some of the key features of 'htop':

  • User-friendly interface: 'htop' provides a visually appealing and easy-to-use interface compared to the standard 'top' command.
  • Color coding: Different process states, such as running, sleeping, or stopping, are color-coded to make it easier to distinguish between processes.
  • Sortable columns: 'htop' allows you to sort the process list by multiple criteria, such as CPU usage, memory usage, and process ID.
  • Detailed process information: 'htop' provides a detailed process information screen that can be accessed by selecting a process with the cursor. This screen provides information on the process's status, memory usage, and other statistics.
  • Process tree view: 'htop' displays a process tree view that shows the relationships between processes and the parent-child relationships between processes.
  • Real-time updates: 'htop' updates its display in real-time, allowing you to see changes in system performance as they occur.
  • Interactive controls: 'htop' provides interactive controls that allow you to perform actions, such as killing a process, directly from the 'htop' interface.

In summary, 'htop' is a powerful and user-friendly system monitoring tool that provides a real-time, interactive overview of the performance of a Linux system.


lscpu 

The command 'iscpu' is not a standard Linux command. It appears to be a typo or a custom command that may not exist on your system.

If you were looking for information about the 'lscpu' command, it is a Linux utility that provides information about the system's CPU architecture. The information provided by 'lscpu' includes the processor type, number of cores, clock speed, and other information. 

To run 'lscpu', open a terminal window and type 'lscpu', and press enter.

username@Technoscience:~$ lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              1
On-line CPU(s) list: 0
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               69
Model name:          Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
Stepping:            1
CPU MHz:             2494.228
BogoMIPS:            4988.45
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            3072K
NUMA node0 CPU(s):   0
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase bmi1 avx2 bmi2 invpcid md_clear flush_l1d
username@Technoscience:~$

These commands are commonly used to gather information about the system, monitor its performance, and diagnose problems.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Ok, Go it!