Select Page

ABIOLA RASP – Raspberries for African School Projects

Wie können wir helfen?

< Alle Themen
Print

The basic Linux commands in detail

no-215 au-03

The basic Linux commands in detail

This article will provide you with the necessary syntax commands to better understand work within a terminal.

Show CPU

You can learn CPU utilizations.

  1. Run below command

top -b -n4 | grep “Cpu(s)” | awk ‘{print $8 “,”}’Cpu-0 utilization: 84.0

2. Cpu-0 utilization: 84.0
3. Cpu-1 utilization: 97.0
4. Cpu-2 utilization: 96.0
5. Cpu-3 utilization: 98.8

Show free Memory

  1. Run below command to learn free memory

free

2. Total Memory: 946392 Mb
3. Used Memory: 179832 Mb
4. Free Memory: 214004 Mb

Show all running processes

  1. To list the running process, run below command

ps -e

2. PID: Every process is assigned a PID (Process Identifier) which is a unique identifier that is associated with a running process in the system
3. TTY: Controlling terminal associated with the process.
4. TIME: Total time of CPU Usage
5. CMD: The command that is executed by the process

Show running processes tree

You can show running processes as a tree.

  1. Run below command

pstree

2. Here is the running process tree

Show System uptime

Print out the system uptime.

  1. Run below command

uptime

2. Time (now)
3. It is the time shows your Raspberry Pi is up.
4. Number of users

Show CPU information

You can learn the CPU information of Raspberry Pi.

  1. Run below command

cat /proc/cpuinfo

2. The information of CPU-0
3. The Information of CPU-1

If you scroll down on terminal, you will see CPU-2 and CPU-3

Show Memory Information

Print out Memory information.

  1. Run below command

cat /proc/meminfo

2. MemTotal: Total usable ram
3. MemFree: Is sum of LowFree  +HighFree  
4. Buffers: Memory in buffer cache.  
5. Cached: Memory in the pagecache minus(-) SwapCache,

Show current version of Raspberry Pi OS

  1. Run below command to show version

cat /proc/version

2. Here is the version

Show last user

You can list the last user of Raspberry Pi

  1. Run below command to show last 5 user

last -n 5

2. User name
3. Login time of user

Show last authorizations

Print last 30 Auth log lines.

  1. Run below command

tail -30 /var/log/auth.log

2. Keep authentication logs for both successful or failed logins, and authentication processes

Restart network service

You can restart your network services.

  1. Run below command

sudo /etc/init.d/networking restart

2. Network is restarted successfully

See also article in the RASP Library.

Zurück Text editors for configuration files
Weiter The official Raspberry PI guide for beginners
Inhaltsverzeichnis