如何使用bash列出的目录中的文件? [英] How to list files in directory using bash?

查看:91
本文介绍了如何使用bash列出的目录中的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何复制一个目录(忽略子目录和链接)到相同的目的地只有普通文件? (在Linux上的bash)
一个非常大的数量的文件


解决方案

 在/来源/目录下的文件/ *

    如果[[-f $ FILE]];然后
        #copy东西....
    科幻
DONE

How to copy only the regular files in a directory (ignoring sub-directories and links) to the same destination? (bash on Linux) A very large number of files

解决方案

for file in /source/directory/*
do
    if [[ -f $file ]]; then
        #copy stuff ....
    fi
done

这篇关于如何使用bash列出的目录中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆