linux命令整理
1.) 显示文件夹下各个文件大小(包含目录和文件)
du -hs *
2.) shell校验日期格式有效性
#!/bin/sh # para # $1 date format # $2 date value # if input bit not enough, result comes to be wrong function check_date() { echo "##### " $* " #####" if [[ "$2" = `date -d "$2" +"$1"` ]] then echo "format($1) date($2)" right return 0; else echo "format($1) date($2)" wrong return 1; fi } check_date "$1" "$2"