System information#

This page looks at Linux utilities that can help you get more information about system status.

System version#

There is a special file in linux that holds information about current system - /etc/os-release. The following cell shows the contents of the file for the current system.

cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.2 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

Process status (ps)#

The ps (process status) command in Linux is used to display information about active system processes. By default, it provides an output table where each row represents a process and the columns include:

  • PID the unique process identifier.

  • TTY the terminal associated with the process.

  • TIME the cumulative CPU time used by the process.

  • CMD the command that initiated the process.

Install ps on ubuntu with package procps (apt install procps).


The following example shows the output of the ps command.

ps
    PID TTY          TIME CMD
    791 pts/3    00:00:00 bash
    811 pts/3    00:00:00 ps

To print all processes in the system, use the -e option, which prints all processes in the system.

The following cell shows the result of ps -e. Only the first 10 rows have been printed, because it could take a long time for the computer to process them.

ps -e | head -n 10
    PID TTY          TIME CMD
      1 pts/0    00:00:00 python3
     20 ?        00:00:00 sh
    145 ?        00:00:00 sh
    164 ?        00:00:00 sh
    171 ?        00:00:00 node
    181 ?        00:00:03 node
    211 ?        00:00:00 sh
    229 ?        00:00:00 node
    251 ?        00:00:00 node

System limits (ulimit)#

The ulimit Linux utility allows you to view and set user-level resource limits. It provides options for each type of limit, enabling you to control various aspects of system resource usage. To display all available limits, use the -a option.

ulimit -a
real-time non-blocking time  (microseconds, -R) unlimited
core file size              (blocks, -c) unlimited
data seg size               (kbytes, -d) unlimited
scheduling priority                 (-e) 0
file size                   (blocks, -f) unlimited
pending signals                     (-i) 126472
max locked memory           (kbytes, -l) 8192
max memory size             (kbytes, -m) unlimited
open files                          (-n) 1048576
pipe size                (512 bytes, -p) 8
POSIX message queues         (bytes, -q) 819200
real-time priority                  (-r) 0
stack size                  (kbytes, -s) 8192
cpu time                   (seconds, -t) unlimited
max user processes                  (-u) unlimited
virtual memory              (kbytes, -v) unlimited
file locks                          (-x) unlimited