【发布时间】:2015-02-17 03:36:58
【问题描述】:
我是 bash 脚本的新手,我发现了这个 example on stackoverflow。现在,这似乎是我需要的,但是我不确定一些事情。
如何正确修改它以显示下载目录中的文件和文件夹的数量
“$@”是什么意思?
到目前为止我的代码:
cleanPath="/home/someuser/Downloads/*"
if [ -d $cleanPath]; then
find "$cleanPath" -type f | ls -l $cleanPath | wc -l | echo "Number of files is $@"
find "$cleanPath" -type d | ls -l $cleanPath | wc -l | echo "Number of directorieis $@"
fi
【问题讨论】: