使用 pdfinfo 批量获取 pdf 页数

#!/bin/bash

# pdf 文件目录
File_Dir='/mnt/d/SynologyDrive/我的桌面/项目归档';

# 收集所有 pdf 文件
find $File_Dir -name "*.pdf" > $File_Dir/files.txt;

# 文件信息写入变量
Files="$(cat $File_Dir/files.txt)";

# 统计文件数量
File_Count=$(echo -e "$Files"|wc -l);

for x in $(seq 1 $File_Count);do
    # 通过指定行获取指定文件
    Exec_File=$(echo -e "$Files"|sed -n "${x}p");
    # 使用 pdfinfo 获取页数
    # pdfinfo 可使用 apt install poppler-utils 安装
    pdfinfo -rawdates "$Exec_File" |tail -7|head -1|awk '{print $2}';
done

消息盒子

# 暂无消息 #

只显示最新10条未读和已读信息