swap
interw@wintercathat-LapTop:~$ sudo swapon --show
[sudo: authenticate] Password:
NAME TYPE SIZE USED PRIO
/swapfile file 512M 320.5M -1
interw@wintercathat-LapTop:~$ free -h
total used free shared buff/cache available
Mem: 7.6Gi 4.1Gi 1.9Gi 340Mi 2.4Gi 3.5Gi
Swap: 511Mi 320Mi 191Mi
sudo swapoff /swapfile
isudo rm /swapfile
sudo fallocate -l 8G /swapfile
isudo chmod 600 /swapfile
interw@wintercathat-LapTop:~$ sudo mkswap /swapfile
Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
no label, UUID=628a0cc8-e023-4e1a-ab18-98e9bcf06d6d
sudo swapon /swapfile
常用
sudo apt update
sudo apt upgrade -y
sudo apt install
sudo apt purge #卸载并删除配置
sudo apt autoremove #清理无用依赖
sudo systemctl status # 查看服务状态
journalct1 -xe #查看最近日志
df -h #磁盘空间
free -h #内存和swap
lsblk -f #块设备和文件系统
ip a #ip地址
ss -tulnp #监听端口
ps aux | grep #查进程
kill PID #结束进程