在 Ubuntu 24.04 网络环境中,经常会遇到一个现象:系统只有一个 IPv6 global address,但没有生成 temporary(隐私地址)。
例如:
inet6 240x:xxxx:xxxx::1/64 scope global dynamic mngtmpaddr noprefixroute
原创2026年6月1日大约 2 分钟
在 Ubuntu 24.04 网络环境中,经常会遇到一个现象:系统只有一个 IPv6 global address,但没有生成 temporary(隐私地址)。
例如:
inet6 240x:xxxx:xxxx::1/64 scope global dynamic mngtmpaddr noprefixroute
背景
s帅.E01.HD1080p.mp4,需要批量格式化为固定模式的文件名 01.mp4#!/bin/bash
# 切换到包含文件的目录
cd /少帅 || exit
# 定义文件名模式作为变量
file_pattern="s帅.E*.HD1080p.mp4"
# 定义正则表达式作为变量
num_regex="E\K\d+"
# 批量重命名文件
for file in $file_pattern; do
# 提取文件中的数字部分
num=$(echo "$file" | grep -oP "$num_regex")
# 构造新的文件名
new_name="${num}.mp4"
# 重命名文件
mv "$file" "$new_name"
echo "Renamed: $file -> $new_name"
done
以下命令在 Ubuntu 22.04.3 LTS 系统上测试
ubuntu@:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jamm
操作环境为 Ubuntu 22.04.2 LTS, 原则上只要有lsof命令即可。
root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
操作环境为 Ubuntu 22.04.2 LTS, 原则上只要有lsof命令即可。
root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
本地主机版本为 Ubuntu 22.04.2 LTS, 原则上只要有ssh命令即可。
root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
以下命令在 Ubuntu 20.04 LTS 系统上测试 , 原则上只要系统是Linux都通用
ubuntu@:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
以下命令在 Ubuntu 20.04 LTS 系统上测试
ubuntu@:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
以下命令在 Ubuntu 20.04 LTS 系统上测试
ubuntu@:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
以下命令在 Ubuntu 20.04 LTS 系统上测试
ubuntu@:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal