cat all files under a directory

This commit is contained in:
zeroway
2016-11-01 17:37:11 +00:00
parent 7c8605fc72
commit 299db12c40

View File

@ -1,4 +1,6 @@
# 查看目录下每个文件的内容
# shell测试脚本(android ksh)
## 查看目录下每个文件的内容
有下面这样一个目录
@ -58,3 +60,15 @@ done
(( i+= 1 ))
done
```
## 查看某个目录下所有的文件的内容
```shell
for f in `ls`
do
if [ -f $f ]
then
echo "$f =" `cat $f`
fi
done
```