...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | shell |
---|
|
htop |
vmstat -s Provides a detailed breakdown of memory usage and other related metrics since the last system boot.
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | shell |
---|
|
free -h
total used free shared buff/cache available
Mem: 7.7G 1.9G 3.9G 487M 1.9G 5.0G
Swap: 2.0G 0B 2.0G |
...
Code Block |
---|
language | bash |
---|
theme | Midnight | title | shell |
---|
|
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 | shell |
---|
|
du -sh /path/to/directory
1.1G /path/to/director
iostat # Reports CPU and I/O statistics. |
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | shell |
---|
|
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 | shell |
---|
|
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]
...
|
...
Code Block |
---|
language | bash |
---|
theme | Midnight | title | shell |
---|
|
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 |
...
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | shell |
---|
|
kill -9 process_id(PID) # Forces termination of a process.
(No output unless there is an error, the process is terminated forcefully) |
...
Code Block |
---|
language | bash |
---|
theme | Midnight | title | shell |
---|
|
dmesg -T
[Wed May 29 14:46:00 2024] Run /init as init process
[Wed May 29 14:46:00 2024] with arguments:
[Wed May 29 14:46:00 2024] /init
[Wed May 29 14:46:00 2024] with environment:
[Wed May 29 14:46:00 2024] HOME=/
[Wed May 29 14:46:00 2024] TERM=linux
[Wed May 29 14:46:00 2024] BOOT_IMAGE=/boot/vmlinuz-5.15.0-97-generic
[Wed May 29 14:46:00 2024] biosdevname=0
[Wed May 29 14:46:00 2024] netcfg/do_not_use_netplan=true
[Wed May 29 14:46:00 2024] piix4_smbus 0000:00:01.3: SMBus Host Controller at 0x700, revision 0
[Wed May 29 14:46:00 2024] scsi host2: Virtio SCSI HBA
[Wed May 29 14:46:00 2024] scsi 2:0:0:0: Direct-Access QEMU QEMU HARDDISK 2.5+ PQ: 0 ANSI: 5
[Wed May 29 14:46:00 2024] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input4
[Wed May 29 14:46:00 2024] input: VirtualPS/2 VMware VMMouse as /devices/platform/i8042/serio1/input/input3
[Wed May 29 14:46:00 2024] cryptd: max_cpu_qlen set to 1000 |
...
Code Block |
---|
language | bash |
---|
theme | Midnight | title | shell |
---|
|
journalctl
-- Logs begin at Tue 2024-06-18 10:55:23 UTC, end at Tue 2024-06-18 12:06:19 UTC. --
Jun 18 10:55:23 hostname kernel: Linux version 5.4.0-74-generic (buildd@lcy01-amd64-013) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #83-Ubuntu SMP Thu May 6 10:34:06 UTC 2021 (Ubuntu 5.4.0-74.83-generic 5.4.101)
Jun 18 10:55:23 hostname kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-74-generic root=UUID=5d7f5dcd-1234-5678-9abc-def012345678 ro quiet splash vt.handoff=7
... |
...
Code Block |
---|
language | bash |
---|
theme | Midnight | title | shell |
---|
|
journalctl -u apache2
-- Logs begin at Tue 2024-06-18 10:55:23 UTC, end at Tue 2024-06-18 12:05:19 UTC. --
Jun 18 11:56:19 hostname systemd[1]: Starting The Apache HTTP Server...
Jun 18 11:56:19 hostname apache2[1342]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Jun 18 11:56:19 hostname systemd[1]: Started The Apache HTTP Server. |
...