linux 替换空格脚本 截取()内部内容脚本
来源:互联网 发布:ummy for mac 编辑:程序博客网 时间:2024/06/01 17:31
修改文件名
去除宫格和保留()中的文件名的脚本
#!/bin/bashfind . -type f -print0 | while read -d $'\0' file;do mv "$file" "$(echo $file | sed 's/ /_/g')";donefor file in `ls *.pdf` do mv $file `echo ${file##*(}`donefind . -type f -print0 | while read -d $'\0' file;do mv "$file" "$(echo $file | sed 's/)//g')";done
</pre><pre code_snippet_id="1559601" snippet_file_name="blog_20160119_3_2699027" name="code" class="plain">特别注意:
1、在linux下可以直接执行<pre code_snippet_id="1559601" snippet_file_name="blog_20160119_3_2699027" name="code" class="plain">find . -type f -print0 | while read -d $'\0' file;do mv "$file" "$(echo $file | sed 's/ /_/g')";done 这样的语句
2、<span style="color:#ff0000;">脚本的文件格式一定要注意,格式不对执行报错,<span style="font-family: 微软雅黑, 'MS Sans Serif', sans-serif; font-size: 13px; widows: auto;">保存为unix格式</span></span>
0 0
- linux 替换空格脚本 截取()内部内容脚本
- linux 截取文件内容脚本
- 查找替换文件内容脚本
- linux脚本批处理替换文件内容的方法
- Linux shell脚本字符串截取
- linux脚本查找关键字替换
- 使用 Perl 脚本做文件内容替换
- solaris下sed脚本替换内容
- Python脚本实现文件内容替换
- 脚本替换
- Linux系统shell脚本判断变量文件目录+l脚本的字符串截取(转)
- linux脚本读取文件内容
- linux脚本读取文件内容
- Linux shell脚本的字符串截取
- Linux shell脚本的字符串截取
- Linux shell脚本的字符串截取
- Linux shell脚本的字符串截取
- Linux shell脚本的字符串截取
- Git的使用(一)
- VB.NET关于Socket分包发送的源码
- react native app离线打包准备
- datatable转换为list
- JAVA中Ping IP地址的两种方法
- linux 替换空格脚本 截取()内部内容脚本
- 四种常见的 POST 提交数据方式
- Library not loaded: /System/Library/Frameworks/LocalAuthentication.framework
- JSON对象添加元素
- Java-获取本地都有哪些字体
- iOS小技巧–用runtime 解决UIButton 重复点击问题
- Android的文件操作
- Android SharedPreferences的简单使用
- 权重轮询调度算法(WeightedRound-RobinScheduling)-Java实现