内容一:查看此时的瞬间网络流量
# ip -s -h link
内容二:持续查看某张网卡的网络流量
# iftop -nN -i eth0
(补充:这里以持续查看名为 eth0 网卡的流量为例)
# ip -s -h link
# iftop -nN -i eth0
(补充:这里以持续查看名为 eth0 网卡的流量为例)
Read-only file system
# mount -o remount rw /run
(补充:这里以重新挂载 /run 目录并给此目录添加读和写权限为例)
非正常关机可能造成文件系统受损,系统重启后,受损的分区自动挂载后就会变成只读。此时修复这个分区则可能修复这个问题
# fsck.ext4 -y /dev/sda1
(补充:这里以修复分区格式为 ext4 的分区 /dev/sda1 为例)
# vim /root/12456.sh
创建以下内容:
#!/bin/bash
for i in {1..5}
do
echo $i
done
(补充:这里以创建 /etc/root/for.sh 脚本为例)
# vim /etc/systemd/system/12456.service
创建以下内容:
[Unit]
Description=12345
After=getty@tty1.service display-manager.service plymouth-start.service
Before=systemd-poweroff.service systemd-halt.service
DefaultDependencies=no
[Service]
ExecStart=/root/12456.sh
Type=forking
[Install]
WantedBy=poweroff.target
WantedBy=reboot.target
WantedBy=halt.target
(补充:这里以创建 /etc/systemd/system/12456.service 来管理 ExecStart=/root/12456.sh 为例)
# systemctl daemon-reload
# chmod u+x /etc/systemd/system/12456.service
# ln -s /usr/lib/systemd/system/12456.service /usr/lib/systemd/system/halt.target.wants/
# ln -s /usr/lib/systemd/system/12456.service /usr/lib/systemd/system/poweroff.target.wants/
# ln -s /usr/lib/systemd/system/12456.service /usr/lib/systemd/system/reboot.target.wants/
# gzip <option> <file>
1) -c or –stdout, write on standard output, keep original files unchanged
2) -d or –decompress, decompress
3) -f or –force, force overwrite of output file and compress links
4) -h or –help, give this help
5) -k or –keep, keep (don’t delete) input files
6) -l or –list, list compressed file contents
7) -n or –no-name, do not save or restore the original name and timestamp
8) -N or –name, save or restore the original name and timestamp
9) -q or –quiet, suppress all warnings
10) -r or –recursive or –rsyncable, operate recursively on directories
11) -t or –test, test compressed file integrity
12) -1 or –fast, compress faster
13) -9 or –best, compress better
# gzip test.txt
(补充:这里以压缩文件 test.txt 为例)
# gzip -d test.txt.xz
(补充:这里以解压文件 test.txt.zx 为例)
# gunzip <option> <file>
1) -c or –stdout, write on standard output, keep original files unchanged
2) -d or –decompress, decompress
3) -f or –force, force overwrite of output file and compress links
4) -h or –help, give this help
5) -k or –keep, keep (don’t delete) input files
6) -l or –list, list compressed file contents
7) -n or –no-name, do not save or restore the original name and timestamp
8) -N or –name, save or restore the original name and timestamp
9) -q or –quiet, suppress all warnings
10) -r or –recursive or –rsyncable, operate recursively on directories
11) -t or –test, test compressed file integrity
12) -1 or –fast, compress faster
13) -9 or –best, compress better
# gunzip test.txt
(补充:这里以压缩文件 test.txt 为例)
# gunzip -d test.txt.xz
(补充:这里以解压文件 test.txt.zx 为例)