当前位置:网站首页>shell iterates over folders and outputs
shell iterates over folders and outputs
2022-08-10 08:59:00 【RemoteDev】
dir=/usr #default directoryif [ -n "$1" ]; then //if parameter 1 is not emptydir=$1 #Modify the default directory to the parameter valueecho "Directory: ${dir}" #Display directoryelseecho "first argument is empty"ficd ${dir} #Enter the directory#Loop through the directory `ls -d */` command to get the directory setfor item in `ls -d */`; doecho ${item} #output directorydone
Effect:
边栏推荐
猜你喜欢
DataStream API(基础篇) 完整使用 (第五章)
【系统设计】S3 对象存储
ARM体系结构2:处理器内核和汇编指令集
iwemeta metaverse: a doll sells for 9999 yuan, and Bubble Mart thinks it is not expensive at all
1 活动时间与安排
It is obvious that a unique index is added, why does it still generate duplicate data?
MySQL的用户临时表与内部临时表
【 WeChat applet 】 read page navigation
The implementation of the seemingly useless component (text gradient) in NaiveUI is so simple
【Unity入门计划】制作RubyAdventure03-使用碰撞体&触发器实现世界交互
随机推荐
郭晶晶家的象棋私教,好家伙是个机器人
大体来讲,网站会被攻击分为几种原因
并查集模板
【OAuth2】十九、OpenID Connect 动态客户端注册
UGUI—事件,iTween插件
幂次方(暑假每日一题 20)
Obtain - 65 [chances] : "soldiers, subtlety also - 7-36 meter reading - defeat
How to use [jmeter regular expression extractor] to solve the problem of returning the value as a parameter
js读取excel时间格式转换
浅谈DAO+DeFi+NFT模式开发代码技术方案丨链游元宇宙NFT盲盒项目技术开发逻辑(源码程序)
【Unity入门计划】2D游戏实现敌人来回移动控制脚本
【FAQ】【Push Kit】推送服务,回执配置一直报错、回执过期修改、怎么删除配置的回执
日期类(暑假每日一题 19)
【系统设计】S3 对象存储
速卖通卖家如何抓住产品搜索权重
爬虫-爬取某小说网站
PTA 习题2.1 简单计算器
DAY25: Logic Vulnerability
Flink快速上手 完整使用 (第二章)
J9 digital science: Web 3.0 is about data ownership or decentralized?