linux下编写shell获取指定目录下的文件名

#!/bin/sh  
#============ get the file name ===========# 
 
FolderPath="/home/data"  
for fileName in ${FolderPath}/*; do  
    tempFile=`basename $fileName`  
    echo $tempFile  
done  

#==========================================#

该方法在后续的用于linux环境下测试会有帮助。

你可能感兴趣的:(linux下编写shell获取指定目录下的文件名)