linux:如何批量递归重命名文件和目录?

时间:2018-09-27 17:45:18

标签: linux bash shell terminal scripting

挑战:

我使用“ iCare Recovery Pro” 从磁盘分区恢复了数据。

const puppeteer = require("puppeteer"); const fs = require("fs"); const request = require("request"); // This is main download function which takes the url of your image function download(uri, filename, callback) { request.head(uri, function(err, res, body) { request(uri) .pipe(fs.createWriteStream(filename)) .on("close", callback); }); } let scrape = async () => { // Actual Scraping goes Here... const browser = await puppeteer.launch({ headless: false }); const page = await browser.newPage(); await page.goto("https://memeculture69.tumblr.com/"); await page.waitFor(1000); const imageUrl = await page.evaluate(() => document.querySelector("img.image") // image selector ); // here we got the image url. // Now just simply pass the image url to the downloader function to download the image. download(imageUrl, "image.png", function() { console.log("Image downloaded"); }); }; scrape() 几个文件,子目录和目录现在在其名称的 END 中添加了新的“ _000 ”。

我尝试过的事情:

我可以使用以下命令查看所有这些信息:

df2.except(df1).show

enter image description here

  

注意::我知道上面的Problem is:命令具有误导性,因为它也会与中间的 _000 相匹配文件/目录名称。 But :我希望您处理 ONLY _000 放在文件/目录名称的末尾。
   请,请 ,如果我使用的是文件名, 保持 ,请使用它的 文件-扩展

建议的解决方案:

我希望脚本在我的根目录中递归地找到 ALL 文件名,子目录名,目录名 em> _000 ”,然后删除该 _000

0 个答案:

没有答案