We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#!/bin/bash folder_path="./" # 进入文件夹 cd "$folder_path" || exit # 获取文件夹下所有的.mp4文件,并按照字母顺序排序 mp4_files=(*.mp4) IFS=$'\n' mp4_files=($(sort -t 'P' -k 2n<<<"${mp4_files[*]}")) unset IFS # 初始化计数器 counter=1 # 逐个重命名文件 for file in "${mp4_files[@]}"; do # 新文件名 new_name="video_${counter}.mp4" # 重命名文件 mv -- "$file" "$new_name" # 计数器递增 ((counter++)) done
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: