...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
vmstat -s
980492 K total memory
480208 K used memory
132040 K active memory
582364 K inactive memory
67924 K free memory
21724 K buffer memory
410636 K swap cache
0 K total swap
0 K used swap
0 K free swap |
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.8G 0 3.8G 0% /dev
tmpfs 783M 1.7M 781M 1% /run
/dev/sda2 233G 25G 197G 12% /
tmpfs 3.9G 39M 3.8G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 783M 80K 783M 1% /run/user/1000 |
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
du du -sh /path/to/directory
1.1G /path/to/director
iostat # Reports CPU and I/O statistics. |
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: XXXXXX-XXX-XXX-XXXX-XXXXXXXXXX
Device Start End Sectors Size Type
/dev/sda1 2048 4095 2048 1M BIOS boot
/dev/sda2 4096 41940607 41936512 20G Linux filesystem |
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 168800 10944 ? Ss Jun12 0:02 /sbin/init
root 2 0.0 0.0 0 0 ? S Jun12 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? I< Jun12 0:00 [rcu_gp]
root 4 0.0 0.0 0 0 ? I< Jun12 0:00 [rcu_par_gp]
...
journalctl -u service_name # Views logs for a specific service.
kill -9 process_id # Forces termination of a process.
nice and renice # Adjusts process priority. |
systemctl status service_name # Checks the status of a service
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2024-05-29 16:06:04 UTC; 2 weeks 5 days ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 1000205 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Main PID: 40385 (apache2)
Tasks: 55 (limit: 1013)
Memory: 8.8M
CPU: 1min 55.654s
CGroup: /system.slice/apache2.service
├─ 40385 /usr/sbin/apache2 -k start
├─1000209 /usr/sbin/apache2 -k start
└─1000210 /usr/sbin/apache2 -k start |
ps aux # Lists all running processes
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Commands |
---|
|
ps aux # Lists all running processes.
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 168800 10944 ? Ss Jun12 0:02 /sbin/init
root 2 0.0 0.0 0 0 ? S Jun12 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? I< Jun12 0:00 [rcu_gp]
root 4 0.0 0.0 0 0 ? I< Jun12 0:00 [rcu_par_gp]
...
|
...
kill -9 process_id(PID) # Forces termination of a process. |
...