递归地从目录的所有子目录中删除空格

find path_to_dir -type d  找到所有子目录
tac 颠倒顺序。这对于使“leaf”目录成为第一位非常重要!
target=... stuff构造新名称,删除空格并保持之前的所有内容相同
echo mv ... 为了安全起见,你应首先使用“echo”运行,如果输出看起来不错,则删除“echo”以真正执行重命名
.

0

linux命令:find /path/to/dir -type d | tac | while read LINE; do target=$(dirname "$LINE")/$(basename "$LINE" | tr -d ' '); echo mv "$LINE" "$target"; done done "$target"; "$LINE" mv echo '); ' -d tr | "$LINE" "$LINE")/$(basename target=$(dirname do LINE; read while | tac | d -type /path/to/dir find find /path/to/dir -type d | tac | while read LINE; do target=$(dirname "$LINE")/$(basename "$LINE" | tr -d ' '); echo mv "$LINE" "$target"; donerootopen.com
linux命令:find /path/to/dir -type d | tac | while read LINE; do target=$(dirname "$LINE")/$(basename "$LINE" | tr -d ' '); echo mv "$LINE" "$target"; done done "$target"; "$LINE" mv echo '); ' -d tr | "$LINE" "$LINE")/$(basename target=$(dirname do LINE; read while | tac | d -type /path/to/dir find find /path/to/dir -type d | tac | while read LINE; do target=$(dirname "$LINE")/$(basename "$LINE" | tr -d ' '); echo mv "$LINE" "$target"; donerootopen.com
gdji 2018-12-08 16:37:53
输出

评论

相关推荐
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

热门文章