我在ubuntu的文件夹中有一个文件夹列表。即。在/ mnt / source / customcode / files / brands /下

root@a919794ec280:/mnt/source/customcode/files/brands# ls -la

total 236

drwxrwxrwx 19 1002 root 4096 Jan 3 09:26 .

drwxrwxrwx 8 1002 1003 4096 Dec 27 22:45 ..

drwxrwxr-x 3 1002 1003 4096 Jan 3 09:22 aem

drwxrwxr-x 3 1002 1003 4096 Jan 3 09:22 apple

drwxrwxr-x 3 1002 1003 4096 Jan 3 09:22 cool

drwxr-xr-x 3 1002 root 4096 Jan 3 09:22 doll

drwxr-xr-x 3 1002 root 4096 Jan 3 09:22 ent

drwxr-xr-x 3 1002 root 4096 Jan 3 09:22 f1

drwxr-xr-x 3 1002 root 4096 Jan 3 09:22 google

drwxrwxrwx 3 1002 root 4096 Jan 3 09:22 h1

drwxrwxr-x 3 1002 1003 4096 Jan 3 09:22 iq

drwxr-xr-x 3 1002 root 4096 Jan 3 09:22 king

drwxrwxrwx 3 root root 4096 Jan 3 09:22 link

drwxrwxrwx 3 1002 root 155648 Jan 3 09:22 nobrand

drwxrwxr-x 3 1002 1003 12288 Jan 3 09:22 pepperfry

drwxrwxrwx 2 1002 root 4096 Jan 3 09:22 pepsi

drwxrwxr-x 2 1002 1003 4096 Jan 3 09:22 rock

drwxrwxrwx 2 1002 root 4096 Jan 3 09:22 star9

drwxrwxr-x 2 1002 1003 4096 Jan 3 09:22 vicks

----- 100+ -----

像上面一样,我有像“a1”,“可乐”,“链接”等文件夹(超过100个文件夹)

在每个文件夹的旁边,将有一个名为“data_aug”的文件夹和“data_aug”文件夹中包含文件。

root@a919794ec280:/mnt/source/customcode/files/brands/apple# ls -la

total 1988

drwxrwxr-x 3 1002 1003 4096 Jan 3 09:22 .

drwxrwxrwx 19 1002 root 4096 Jan 3 09:26 ..

-rw-r--r-- 1 1002 1003 17465 Dec 29 23:28 0DPA0C3.jpg

-rw-r--r-- 1 1002 1003 3836 Dec 31 00:55 130418131111-apple-store-santa-monica.jpg

-rw-r--r-- 1 1002 1003 48616 Dec 31 00:52 15146774227434507677123475441338.jpg

-rw-r--r-- 1 1002 1003 9107 Dec 31 00:52 15146774615326659565665852728294.jpg

-rw-r--r-- 1 1002 1003 28005 Dec 29 23:28 3D-Apple-Logo-Wallpapers.jpg

-rw-r--r-- 1 1002 1003 75855 Dec 29 23:28 3D-Apple-Logo.jpg

-rw-r--r-- 1 1002 1003 27403 Dec 29 23:28 3d_apple_logo___wallpaper_by_techflashdesigns-d4fbc7p.jpg

-rw-r--r-- 1 1002 1003 38420 Dec 29 23:28 AX62GjL.jpg

-rw-r--r-- 1 1002 1003 6025 Dec 29 23:28 Apple-Logo-2016 (1).jpg

-rw-r--r-- 1 1002 1003 929419 Dec 29 23:28 Apple-Logo-Png-Download.png

-rw-r--r-- 1 1002 1003 35742 Dec 29 23:28 apple-logo-2016.jpg

-rw-r--r-- 1 1002 1003 15301 Dec 29 23:28 apple-logo-3d-model-max-obj-fbx-3dm-ige-igs-iges.jpg

-rw-r--r-- 1 1002 1003 42514 Dec 29 23:28 apple-logo-clipart-2.jpeg

-rw-r--r-- 1 1002 1003 152183 Dec 29 23:28 apple-logo-clouds.jpg

-rw-r--r-- 1 1002 1003 6117 Dec 31 00:55 apple1.jpg

-rw-r--r-- 1 1002 1003 349787 Dec 29 23:28 apple_ipad_logo.png

-rw-r--r-- 1 1002 1003 54167 Dec 29 23:28 b5c4d6c9-3.jpg

drwxr-xr-x 2 root root 4096 Jan 3 09:22 data_aug

-rw-r--r-- 1 1002 1003 32918 Dec 29 23:28 large.JPG

-rw-r--r-- 1 1002 1003 48972 Dec 29 23:28 medium.jpg

-rw-r--r-- 1 1002 1003 3609 Dec 29 23:28 th (1).jpeg

-rw-r--r-- 1 1002 1003 30392 Dec 29 23:28 th (2).jpeg

-rw-r--r-- 1 1002 1003 3222 Dec 29 23:28 th.jpeg

-rw-r--r-- 1 1002 1003 22544 Dec 29 23:28 u5TAcBk.jpg

root@a919794ec280:/mnt/source/customcode/files/brands/apple/data_aug# ls -la

total 4356

drwxr-xr-x 2 root root 12288 Jan 3 09:41 .

drwxrwxr-x 3 1002 1003 4096 Jan 3 09:22 ..

-rw-r--r-- 1 root root 10450 Jan 3 09:40 apple_0_1.jpeg

-rw-r--r-- 1 root root 5599 Jan 3 09:40 apple_0_1019.jpeg

-rw-r--r-- 1 root root 3225 Jan 3 09:40 apple_0_1075.jpeg

-rw-r--r-- 1 root root 10283 Jan 3 09:40 apple_0_1100.jpeg

-rw-r--r-- 1 root root 13923 Jan 3 09:41 apple_0_1119.jpeg

现在...

我需要一个脚本放在“/ mnt / source / customcode /”中

想要从“/ mnt / source / customcode /”运行脚本,因为我的脚本相关文件只能从“/ mnt / source / customcode /”执行以实现。

从所有100个文件夹中递归删除文件夹“data_aug”和“data_aug”内的数据。

然后从“/ mnt / source / customcode /”位置我应该执行一个

特殊脚本,它会引用那100个文件夹。比如说

下面。

码...

python -m scripts.augmentation_keras --image_dir=files/brands/apple --target_dir=files/brands/apple/data_aug --save_prefix=apple

python -m scripts.augmentation_keras --image_dir=files/brands/a1 --target_dir=files/brands/a1/data_aug --save_prefix=a1

像上面所有100个文件夹一样。文件夹100的数量将来会增长得更多。

我怎么能动态地做,而不是用数百行编写简单的脚本(静态删除和执行)!

谢谢。

linux ls命令shell脚本位置,linux - shell脚本到ls并在ls上执行命令结果 - SO中文参考 - www.soinside.com...相关推荐

  1. 我写了一个脚本,可在“任意”服务器上执行命令!

    冰河之前维护着上千台服务器组成的服务器集群,如果每次需要在服务器上执行命令的时候,都要手动登录每台服务器进行操作的话,那也太麻烦了.你想想,如果在上千台服务器的集群中,每台服务器中只需要简单的执行一个 ...

  2. 使用pssh批量在多台主机上执行命令

    使用pssh批量在多台主机上执行命令 Centos7安装pssh yum安装pssh pip2安装pssh 编写host.txt 常用参数 基本使用 自动接受hostkey 执行结果输出到文件 直接打 ...

  3. crt脚本怎么添加等待时间_如何在重启或启动时执行命令或脚本 | Linux 中国

    有时你需要在启动时添加自定义脚本.命令或服务,该怎么做? 来源:https://linux.cn/article-12279-1.html 作者:Magesh Maruthamuthu 译者:geek ...

  4. Pssh -- 使用单个终端在多个远程Linux服务器上执行命令

    OpenSSH毫无疑问是可用于Linux的使用最广泛和强大工具之一,它允许你通过一个shell安全地连接到远程Linux系统,并且允许你与远程系统之间来回传输文件. 但OpenSSH的最大缺点是你不同 ...

  5. linux中的crontab文件位置,linux crontab 文件位置和日志位置

    一.文件位置 位置一般在/var/spool/cron/下,如果你是root用户,那下面有个root文件,建议日常备份,避免误删除导致crontab 文件丢失: 二.日志文件位置 默认情况下,cron ...

  6. Mac上执行命令“brew install *”时需谨慎,警惕homebrew自动更新python3.7导致第三方模块被格式化

    问题描述: 准备通过pip3 install pyenchant安装PyEnchant模块,实现识别输入字符串是否为有效英文单词的功能.结果安装后执行如下测试脚本报错ImportError : The ...

  7. shell看java控制台_java - 为什么我的shell脚本的输出不能打印在控制台? - SO中文参考 - www.soinside.com...

    我试图用java在控制台打印一个shell脚本的输出.当我手动运行该脚本时,我得到C:/Users/user1/Desktop/shell.sh: line 78: /usr/ucb/ps: No s ...

  8. linux信号值头文件位置,Linux C 信号处理机制

    一 . 信号 1. 信号:是内核发送给某一进程的一种消息 . 2. 信号机制:是Linux系统中用于进程之间相互通信或操作的一种机制. 3. 信号的来源:信号来源于内核 4. 产生原因: (1)用户通 ...

  9. linux环境发送中文失败,linux - 无法从linux命令发送邮件 - SO中文参考 - www.soinside.com...

    我想从linux命令发送电子邮件.我安装在ubuntu ssmtp中,然后在/etc/ssmtp/ssmtp.conf中配置它:root=mymail@gmail.com mailhub=smtp.g ...

最新文章

  1. AngularJS从子控制器访问父作用域
  2. ARP命令详解--网络命令详解二
  3. python怎么导入时间-Python的import导入与时间
  4. [总结] 平衡树总结
  5. 拟合一条曲线_数据预测与曲线拟合
  6. 【转】struct epoll_event
  7. endnote无法同步原因_endnote不能同步(endnote retrieving references)的解决方法
  8. 利用openmp实现矩阵相乘_MP116:线性代数补习班(4):矩阵的张量积
  9. android.opengl.GLSurfaceView.Renderer概述
  10. 查询英语单词 - 有道官方(一)
  11. ORACLE10G让空间管理变轻松【SPACE MANAGEMENT MAKE EASILY ON ORACLE10G】
  12. java坦克大战图片素材包,坦克大战素材包
  13. KITTY数据集 下载 及 使用
  14. Android单点触摸与多点触摸
  15. Java学习里程-----Java基础_26 BigDecimal类
  16. 分享暄桐好作业之《临〈岁朝清供图〉》
  17. 用计算机升级ipad系统软件,iPad如何升级系统?三种ipad升级系统的方法汇总
  18. 汉字与UNICODE的转换 通过文件操作
  19. 在andriod手机上video视频播放时自动置顶自动全屏的问题
  20. 毕业设计-基于微信小程序的实验室服务系统

热门文章

  1. HA集群之三:corosync+pacemaker实现httpd服务的高可用
  2. OpenWrt [mktplinkfw] *** error: images are too big
  3. (转) Android平台上关于IM的实践总结
  4. 开学季|计算机专业的你看过来!
  5. 真实的程序员是什么样子的!
  6. 局域网聊天关心他们的教育
  7. 对 飞秋 程序设计的一些新想法
  8. 桌面Linux市场份额终于突破1%
  9. 这是 Google 工程师 Amit Singhal 发表在 Google 官方博客的一篇文章,讲述了 Google 搜索排名背后的一些技术,涉及到 Google 对网页,对语义,对用户意图的理解。
  10. IBM发布32纳米芯片技术 明年下半年量产