linux shell 编程, 输入目录显示该目录下所有文件名

#!bin/bash
read -p "请输入目录" Dir
echo $Dir
cd /$Dir
for file in $(ls *)
do
        echo $file
done

 

posted @ 2020-10-09 14:28  hulian425  阅读(484)  评论(0编辑  收藏  举报