Skip to content

Commit

Permalink
🎉auto update by Gmeek action
Browse files Browse the repository at this point in the history
  • Loading branch information
Windy147 committed Apr 17, 2024
1 parent acad19b commit 9a185b7
Show file tree
Hide file tree
Showing 7 changed files with 262 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Blog Title :link: https://Windy147.github.io/windy.github.io
### :page_facing_up: [11](https://Windy147.github.io/windy.github.io/tag.html)
### :page_facing_up: [12](https://Windy147.github.io/windy.github.io/tag.html)
### :speech_balloon: 1
### :hibiscus: 2367
### :alarm_clock: 2024-04-17 18:01:20
### :hibiscus: 2775
### :alarm_clock: 2024-04-17 18:02:36
### Powered by :heart: [Gmeek](https://github.com/Meekdai/Gmeek)
27 changes: 27 additions & 0 deletions backup/批量重命名(含空格的文件).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```
#!/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
```
2 changes: 1 addition & 1 deletion blogBase.json

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,18 @@ <h1>
<div id="content">
<div style="margin-bottom: 16px;">Blog description</div>
<nav class="SideNav border">
<a class="SideNav-item d-flex flex-items-center flex-justify-between" href="post/pi-liang-zhong-ming-ming-%EF%BC%88-shu-zi-wei-ming-%EF%BC%89.html">
<a class="SideNav-item d-flex flex-items-center flex-justify-between" href="post/pi-liang-zhong-ming-ming-%EF%BC%88-han-kong-ge-de-wen-jian-%EF%BC%89.html">
<div class="d-flex flex-items-center">
<svg class="SideNav-icon octicon" style="witdh:16px;height:16px"><path class="svgTop0" d=""></path>
</svg>
<span class="listTitle">批量重命名(含空格的文件)</span>
</div>
<div class="listLabels">

<span class="Label LabelName" style="background-color:#0075ca"><object><a style="color:#fff" href="tag.html#documentation">documentation</a></object></span>
<span class="Label LabelTime" style="background-color:#bc4c00">2024-04-17</span>
</div>
</a><a class="SideNav-item d-flex flex-items-center flex-justify-between" href="post/pi-liang-zhong-ming-ming-%EF%BC%88-shu-zi-wei-ming-%EF%BC%89.html">
<div class="d-flex flex-items-center">
<svg class="SideNav-icon octicon" style="witdh:16px;height:16px"><path class="svgTop0" d=""></path>
</svg>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<!DOCTYPE html>
<html data-color-mode="light" data-dark-theme="dark" data-light-theme="light" lang="zh-CN">
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="//cdn.staticfile.net/Primer/21.0.7/primer.css" rel="stylesheet" />
<link rel="icon" href="https://github.githubassets.com/favicons/favicon.svg"><script>
let theme = localStorage.getItem("meek_theme") || "light";
document.documentElement.setAttribute("data-color-mode", theme);
</script>
<meta name="description" content="批量重命名(含空格的文件)">
<title>批量重命名(含空格的文件)</title>


</head>
<style>
body{box-sizing: border-box;min-width: 200px;max-width: 900px;margin: 20px auto;padding: 45px;font-size: 16px;font-family: sans-serif;line-height: 1.25;}
#header{display:flex;padding-bottom:8px;border-bottom: 1px solid var(--borderColor-muted, var(--color-border-muted));margin-bottom: 16px;}
#footer {margin-top:64px; text-align: center;font-size: small;}

</style>

<style>
.postTitle{margin: auto 0;font-size:40px;font-weight:bold;}
.title-right{display:flex;margin:auto 0 0 auto;}
.title-right .circle{padding: 14px 16px;margin-right:8px;}
#postBody{border-bottom: 1px solid var(--color-border-default);padding-bottom:36px;}
#postBody hr{height:2px;}
#cmButton{height:48px;margin-top:48px;}
#comments{margin-top:64px;}
.g-emoji{font-size:24px;}
@media (max-width: 600px) {
body {padding: 8px;}
.postTitle{font-size:24px;}
}
</style>




<body>
<div id="header">
<h1 class="postTitle">批量重命名(含空格的文件)</h1>
<div class="title-right">
<a href="https://Windy147.github.io/windy.github.io" id="buttonHome" class="btn btn-invisible circle" title="首页">
<svg class="octicon" width="16" height="16">
<path id="pathHome" fill-rule="evenodd"></path>
</svg>
</a>

<a href="https://github.com/Windy147/windy.github.io/issues/13" target="_blank" class="btn btn-invisible circle" title="Issue">
<svg class="octicon" width="16" height="16">
<path id="pathIssue" fill-rule="evenodd"></path>
</svg>
</a>


<a class="btn btn-invisible circle" onclick="modeSwitch();" title="切换主题">
<svg class="octicon" width="16" height="16" >
<path id="themeSwitch" fill-rule="evenodd"></path>
</svg>
</a>

</div>
</div>
<div id="content">
<div class="markdown-body" id="postBody"><pre class="notranslate"><code class="notranslate">#!/bin/bash

folder_path="./"
# 进入文件夹
cd "$folder_path" || exit

# 获取文件夹下所有的.mp4文件,并按照字母顺序排序
mp4_files=(*.mp4)
IFS=$'\n' mp4_files=($(sort -t 'P' -k 2n&lt;&lt;&lt;"${mp4_files[*]}"))
unset IFS

# 初始化计数器
counter=1

# 逐个重命名文件
for file in "${mp4_files[@]}"; do
# 新文件名
new_name="video_${counter}.mp4"
# 重命名文件
mv -- "$file" "$new_name"
# 计数器递增
((counter++))
done


</code></pre></div>
<div style="font-size:small;margin-top:8px;float:right;"></div>
<button class="btn btn-block" type="button" onclick="openComments()" id="cmButton">评论</button>
<div class="comments" id="comments"></div>
</div>
<div id="footer">Copyright © <span id="year"></span><a href="https://Windy147.github.io/windy.github.io"> Blog Title </a>
<p>
<span id="runday"></span>Powered by <a href="https://meekdai.com/Gmeek.html" target="_blank">Gmeek</a>
</p>

<script>
if(""!=""){
var now=new Date();
var startSite=new Date("");
var diff=now.getTime()-startSite.getTime();
var diffDay=Math.floor(diff/(1000*60*60*24));
document.getElementById("year").innerHTML=now.getFullYear();
if(""!=""){document.getElementById("runday").innerHTML=" • "+"网站运行"+diffDay+"天"+" • ";}
else{document.getElementById("runday").innerHTML="网站运行"+diffDay+"天"+" • ";}
}
</script>
</div>
</body>
<script>
var IconList={'sun': 'M8 10.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zM8 12a4 4 0 100-8 4 4 0 000 8zM8 0a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0V.75A.75.75 0 018 0zm0 13a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 018 13zM2.343 2.343a.75.75 0 011.061 0l1.06 1.061a.75.75 0 01-1.06 1.06l-1.06-1.06a.75.75 0 010-1.06zm9.193 9.193a.75.75 0 011.06 0l1.061 1.06a.75.75 0 01-1.06 1.061l-1.061-1.06a.75.75 0 010-1.061zM16 8a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 0116 8zM3 8a.75.75 0 01-.75.75H.75a.75.75 0 010-1.5h1.5A.75.75 0 013 8zm10.657-5.657a.75.75 0 010 1.061l-1.061 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zm-9.193 9.193a.75.75 0 010 1.06l-1.06 1.061a.75.75 0 11-1.061-1.06l1.06-1.061a.75.75 0 011.061 0z', 'moon': 'M9.598 1.591a.75.75 0 01.785-.175 7 7 0 11-8.967 8.967.75.75 0 01.961-.96 5.5 5.5 0 007.046-7.046.75.75 0 01.175-.786zm1.616 1.945a7 7 0 01-7.678 7.678 5.5 5.5 0 107.678-7.678z', 'sync': 'M1.705 8.005a.75.75 0 0 1 .834.656 5.5 5.5 0 0 0 9.592 2.97l-1.204-1.204a.25.25 0 0 1 .177-.427h3.646a.25.25 0 0 1 .25.25v3.646a.25.25 0 0 1-.427.177l-1.38-1.38A7.002 7.002 0 0 1 1.05 8.84a.75.75 0 0 1 .656-.834ZM8 2.5a5.487 5.487 0 0 0-4.131 1.869l1.204 1.204A.25.25 0 0 1 4.896 6H1.25A.25.25 0 0 1 1 5.75V2.104a.25.25 0 0 1 .427-.177l1.38 1.38A7.002 7.002 0 0 1 14.95 7.16a.75.75 0 0 1-1.49.178A5.5 5.5 0 0 0 8 2.5Z', 'home': 'M6.906.664a1.749 1.749 0 0 1 2.187 0l5.25 4.2c.415.332.657.835.657 1.367v7.019A1.75 1.75 0 0 1 13.25 15h-3.5a.75.75 0 0 1-.75-.75V9H7v5.25a.75.75 0 0 1-.75.75h-3.5A1.75 1.75 0 0 1 1 13.25V6.23c0-.531.242-1.034.657-1.366l5.25-4.2Zm1.25 1.171a.25.25 0 0 0-.312 0l-5.25 4.2a.25.25 0 0 0-.094.196v7.019c0 .138.112.25.25.25H5.5V8.25a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 .75.75v5.25h2.75a.25.25 0 0 0 .25-.25V6.23a.25.25 0 0 0-.094-.195Z', 'github': 'M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z'};
var utterancesLoad=0;

let themeSettings={
"dark": ["dark","moon","#00f0ff","dark-blue"],
"light": ["light","sun","#ff5000","github-light"],
"auto": ["auto","sync","","preferred-color-scheme"]
};
function changeTheme(mode, icon, color, utheme){
document.documentElement.setAttribute("data-color-mode",mode);
document.getElementById("themeSwitch").setAttribute("d",value=IconList[icon]);
document.getElementById("themeSwitch").parentNode.style.color=color;
if(utterancesLoad==1){utterancesTheme(utheme);}
}
function modeSwitch(){
let currentMode=document.documentElement.getAttribute('data-color-mode');
let newMode = currentMode === "light" ? "dark" : currentMode === "dark" ? "auto" : "light";
localStorage.setItem("meek_theme", newMode);
if(themeSettings[newMode]){
changeTheme(...themeSettings[newMode]);
}
}
function utterancesTheme(theme){
const message={type:'set-theme',theme: theme};
const iframe=document.getElementsByClassName('utterances-frame')[0];
iframe.contentWindow.postMessage(message,'https://utteranc.es');
}
if(themeSettings[theme]){changeTheme(...themeSettings[theme]);}
console.log("\n %c Gmeek last https://github.com/Meekdai/Gmeek \n\n","padding:5px 0;background:#02d81d;color:#fff");
</script>

<script>
document.getElementById("pathHome").setAttribute("d",IconList["home"]);
document.getElementById("pathIssue").setAttribute("d",IconList["github"]);

function openComments(){
cm=document.getElementById("comments");
cmButton=document.getElementById("cmButton");
cmButton.innerHTML="loading";
span=document.createElement("span");
span.setAttribute("class","AnimatedEllipsis");
cmButton.appendChild(span);

script=document.createElement("script");
script.setAttribute("src","https://utteranc.es/client.js");
script.setAttribute("repo","Windy147/windy.github.io");
script.setAttribute("issue-term","title");

if(localStorage.getItem("meek_theme")=="dark"){script.setAttribute("theme","dark-blue");}
else if(localStorage.getItem("meek_theme")=="light") {script.setAttribute("theme","github-light");}
else{script.setAttribute("theme","preferred-color-scheme");}

script.setAttribute("crossorigin","anonymous");
script.setAttribute("async","");
cm.appendChild(script);

int=self.setInterval("iFrameLoading()",200);
}

function iFrameLoading(){
var utterances=document.getElementsByClassName('utterances');
if(utterances.length==1){
if(utterances[0].style.height!=""){
utterancesLoad=1;
int=window.clearInterval(int);
document.getElementById("cmButton").style.display="none";
console.log("utterances Load OK");
}
}
}
</script>



</html>
2 changes: 1 addition & 1 deletion docs/postList.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"P12": {"labels": ["documentation"], "postTitle": "\u6279\u91cf\u91cd\u547d\u540d\uff08\u6570\u5b57\u4e3a\u540d\uff09", "postUrl": "post/pi-liang-zhong-ming-ming-%EF%BC%88-shu-zi-wei-ming-%EF%BC%89.html", "createdDate": "2024-04-17", "dateLabelColor": "#bc4c00"}, "P11": {"labels": ["documentation"], "postTitle": "\u4f7f\u7528ffmpeg\u5faa\u73af\u63a8\u6d41", "postUrl": "post/shi-yong-ffmpeg-xun-huan-tui-liu.html", "createdDate": "2024-04-17", "dateLabelColor": "#bc4c00"}, "P10": {"labels": ["documentation"], "postTitle": "ffmpeg\u5408\u5e76rmvb\u683c\u5f0f\u6587\u4ef6", "postUrl": "post/ffmpeg-he-bing-rmvb-ge-shi-wen-jian.html", "createdDate": "2024-04-17", "dateLabelColor": "#bc4c00"}, "P9": {"labels": ["documentation"], "postTitle": "\u4f7f\u7528ffmpeg\u63a8\u6d41mkv\u683c\u5f0f\u89c6\u9891", "postUrl": "post/shi-yong-ffmpeg-tui-liu-mkv-ge-shi-shi-pin.html", "createdDate": "2024-04-16", "dateLabelColor": "#bc4c00"}, "P8": {"labels": ["documentation"], "postTitle": "\u63a8\u6d41\u670d\u52a1\u5668\u642d\u5efa", "postUrl": "post/tui-liu-fu-wu-qi-da-jian.html", "createdDate": "2024-04-16", "dateLabelColor": "#bc4c00"}, "P7": {"labels": ["documentation"], "postTitle": "\u4f7f\u7528ffmpeg\u6279\u91cf\u5408\u5e76mp4\u6587\u4ef6", "postUrl": "post/shi-yong-ffmpeg-pi-liang-he-bing-mp4-wen-jian.html", "createdDate": "2024-04-06", "dateLabelColor": "#bc4c00"}, "P6": {"labels": ["documentation"], "postTitle": "yay or pacman \u5e38\u7528\u547d\u4ee4", "postUrl": "post/yay%20or%20pacman%20-chang-yong-ming-ling.html", "createdDate": "2024-04-05", "dateLabelColor": "#bc4c00"}, "P5": {"labels": ["documentation"], "postTitle": "nmap \u5e38\u7528\u547d\u4ee4", "postUrl": "post/nmap%20-chang-yong-ming-ling.html", "createdDate": "2024-04-05", "dateLabelColor": "#bc4c00"}, "P4": {"labels": ["documentation"], "postTitle": "ubuntu\u5b89\u88c5plasma\u684c\u9762\u73af\u5883", "postUrl": "post/ubuntu-an-zhuang-plasma-zhuo-mian-huan-jing.html", "createdDate": "2024-04-05", "dateLabelColor": "#bc4c00"}, "P3": {"labels": ["documentation"], "postTitle": "linux\u66f4\u6362\u4e3b\u673a\u540d", "postUrl": "post/linux-geng-huan-zhu-ji-ming.html", "createdDate": "2024-04-02", "dateLabelColor": "#bc4c00"}, "P2": {"labels": ["documentation"], "postTitle": "linux\u6362\u6e90", "postUrl": "post/linux-huan-yuan.html", "createdDate": "2024-04-01", "dateLabelColor": "#bc4c00"}, "labelColorDict": {"bug": "#d73a4a", "documentation": "#0075ca", "duplicate": "#cfd3d7", "enhancement": "#a2eeef", "good first issue": "#7057ff", "help wanted": "#008672", "invalid": "#e4e669", "question": "#d876e3", "wontfix": "#ffffff"}}
{"P13": {"labels": ["documentation"], "postTitle": "\u6279\u91cf\u91cd\u547d\u540d\uff08\u542b\u7a7a\u683c\u7684\u6587\u4ef6\uff09", "postUrl": "post/pi-liang-zhong-ming-ming-%EF%BC%88-han-kong-ge-de-wen-jian-%EF%BC%89.html", "createdDate": "2024-04-17", "dateLabelColor": "#bc4c00"}, "P12": {"labels": ["documentation"], "postTitle": "\u6279\u91cf\u91cd\u547d\u540d\uff08\u6570\u5b57\u4e3a\u540d\uff09", "postUrl": "post/pi-liang-zhong-ming-ming-%EF%BC%88-shu-zi-wei-ming-%EF%BC%89.html", "createdDate": "2024-04-17", "dateLabelColor": "#bc4c00"}, "P11": {"labels": ["documentation"], "postTitle": "\u4f7f\u7528ffmpeg\u5faa\u73af\u63a8\u6d41", "postUrl": "post/shi-yong-ffmpeg-xun-huan-tui-liu.html", "createdDate": "2024-04-17", "dateLabelColor": "#bc4c00"}, "P10": {"labels": ["documentation"], "postTitle": "ffmpeg\u5408\u5e76rmvb\u683c\u5f0f\u6587\u4ef6", "postUrl": "post/ffmpeg-he-bing-rmvb-ge-shi-wen-jian.html", "createdDate": "2024-04-17", "dateLabelColor": "#bc4c00"}, "P9": {"labels": ["documentation"], "postTitle": "\u4f7f\u7528ffmpeg\u63a8\u6d41mkv\u683c\u5f0f\u89c6\u9891", "postUrl": "post/shi-yong-ffmpeg-tui-liu-mkv-ge-shi-shi-pin.html", "createdDate": "2024-04-16", "dateLabelColor": "#bc4c00"}, "P8": {"labels": ["documentation"], "postTitle": "\u63a8\u6d41\u670d\u52a1\u5668\u642d\u5efa", "postUrl": "post/tui-liu-fu-wu-qi-da-jian.html", "createdDate": "2024-04-16", "dateLabelColor": "#bc4c00"}, "P7": {"labels": ["documentation"], "postTitle": "\u4f7f\u7528ffmpeg\u6279\u91cf\u5408\u5e76mp4\u6587\u4ef6", "postUrl": "post/shi-yong-ffmpeg-pi-liang-he-bing-mp4-wen-jian.html", "createdDate": "2024-04-06", "dateLabelColor": "#bc4c00"}, "P6": {"labels": ["documentation"], "postTitle": "yay or pacman \u5e38\u7528\u547d\u4ee4", "postUrl": "post/yay%20or%20pacman%20-chang-yong-ming-ling.html", "createdDate": "2024-04-05", "dateLabelColor": "#bc4c00"}, "P5": {"labels": ["documentation"], "postTitle": "nmap \u5e38\u7528\u547d\u4ee4", "postUrl": "post/nmap%20-chang-yong-ming-ling.html", "createdDate": "2024-04-05", "dateLabelColor": "#bc4c00"}, "P4": {"labels": ["documentation"], "postTitle": "ubuntu\u5b89\u88c5plasma\u684c\u9762\u73af\u5883", "postUrl": "post/ubuntu-an-zhuang-plasma-zhuo-mian-huan-jing.html", "createdDate": "2024-04-05", "dateLabelColor": "#bc4c00"}, "P3": {"labels": ["documentation"], "postTitle": "linux\u66f4\u6362\u4e3b\u673a\u540d", "postUrl": "post/linux-geng-huan-zhu-ji-ming.html", "createdDate": "2024-04-02", "dateLabelColor": "#bc4c00"}, "P2": {"labels": ["documentation"], "postTitle": "linux\u6362\u6e90", "postUrl": "post/linux-huan-yuan.html", "createdDate": "2024-04-01", "dateLabelColor": "#bc4c00"}, "labelColorDict": {"bug": "#d73a4a", "documentation": "#0075ca", "duplicate": "#cfd3d7", "enhancement": "#a2eeef", "good first issue": "#7057ff", "help wanted": "#008672", "invalid": "#e4e669", "question": "#d876e3", "wontfix": "#ffffff"}}
28 changes: 27 additions & 1 deletion docs/rss.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><title>Blog Title</title><link>https://Windy147.github.io/windy.github.io</link><description>Blog description</description><copyright>Blog Title</copyright><docs>http://www.rssboard.org/rss-specification</docs><generator>python-feedgen</generator><image><url>https://github.githubassets.com/favicons/favicon.svg</url><title>avatar</title><link>https://Windy147.github.io/windy.github.io</link></image><lastBuildDate>Wed, 17 Apr 2024 10:01:20 +0000</lastBuildDate><managingEditor>Blog Title</managingEditor><ttl>60</ttl><webMaster>Blog Title</webMaster><item><title>批量重命名(数字为名)</title><link>https://Windy147.github.io/windy.github.io/post/pi-liang-zhong-ming-ming-%EF%BC%88-shu-zi-wei-ming-%EF%BC%89.html</link><description>```&#13;
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><title>Blog Title</title><link>https://Windy147.github.io/windy.github.io</link><description>Blog description</description><copyright>Blog Title</copyright><docs>http://www.rssboard.org/rss-specification</docs><generator>python-feedgen</generator><image><url>https://github.githubassets.com/favicons/favicon.svg</url><title>avatar</title><link>https://Windy147.github.io/windy.github.io</link></image><lastBuildDate>Wed, 17 Apr 2024 10:02:36 +0000</lastBuildDate><managingEditor>Blog Title</managingEditor><ttl>60</ttl><webMaster>Blog Title</webMaster><item><title>批量重命名(含空格的文件)</title><link>https://Windy147.github.io/windy.github.io/post/pi-liang-zhong-ming-ming-%EF%BC%88-han-kong-ge-de-wen-jian-%EF%BC%89.html</link><description>```&#13;
#!/bin/bash&#13;
&#13;
folder_path="./"&#13;
# 进入文件夹&#13;
cd "$folder_path" || exit&#13;
&#13;
# 获取文件夹下所有的.mp4文件,并按照字母顺序排序&#13;
mp4_files=(*.mp4)&#13;
IFS=$'\n' mp4_files=($(sort -t 'P' -k 2n&lt;&lt;&lt;"${mp4_files[*]}"))&#13;
unset IFS&#13;
&#13;
# 初始化计数器&#13;
counter=1&#13;
&#13;
# 逐个重命名文件&#13;
for file in "${mp4_files[@]}"; do&#13;
# 新文件名&#13;
new_name="video_${counter}.mp4"&#13;
# 重命名文件&#13;
mv -- "$file" "$new_name"&#13;
# 计数器递增&#13;
((counter++))&#13;
done&#13;
&#13;
&#13;
```。</description><guid isPermaLink="true">https://Windy147.github.io/windy.github.io/post/pi-liang-zhong-ming-ming-%EF%BC%88-han-kong-ge-de-wen-jian-%EF%BC%89.html</guid><pubDate>Wed, 17 Apr 2024 10:02:11 +0000</pubDate></item><item><title>批量重命名(数字为名)</title><link>https://Windy147.github.io/windy.github.io/post/pi-liang-zhong-ming-ming-%EF%BC%88-shu-zi-wei-ming-%EF%BC%89.html</link><description>```&#13;
#!/bin/bash&#13;
&#13;
count=1&#13;
Expand Down

0 comments on commit 9a185b7

Please sign in to comment.