to make a script to check a directory?
#!/usr/bin/bash
#check the information of a directory
#Asha 2017/4/17
if [ ! -d $1 ]
then
echo there is no this directory.
exit
fi
echo we have `ls -p $1 | grep '[^/]$' | sed 's/\s\s*//g' | wc -w` files inside this directory.
echo we have `ls -p $1 | grep '[/]$' | sed 's/\s\s*//g' | wc -w` directories inside this directory.
echo the biggest file `ls -l $1| tail -n +2 | sed 's/\s\s*/ /g' | cut -d ' ' -f 5,9 | sort -n | cut -d ' ' -f 2| tail -1`.
echo the latest modification file or directory is `ls -l -t$1| tain -n +2 | head -1`.
echo the owners of files or directories inside this directory is/are `ls -l
$1 | tail -n +2 | sed 's/\s\s*/ /g' | cut -d ' ' -f 3 | uniq`.