環境:CentOS
1. 查看當前目錄(含子目錄)總大小
$ du -sh
1.4M .
2. 查看當前目錄總大小及子目錄大小
$ du -h
4.0K ./folder
1.4M .
3. 查看自己空間和文件配額
$ quota
Disk quotas for user zilzhang (uid 110111452):
Filesystem blocks quota limit grace files quota limit grace
my.com 307004 5242880 5242880 115 4294967295 4294967295
4. sh 執行命令
echo "ls -lrt" | sh
5. 發email 程序
/usr/sbin/sendmail -f
[email protected] $EMAIL_TO $EMAIL_CC <<EOF
Subject: $ENV Table $TABLE_NAME Check Volume Do Not Pass
MIME-Version: 1.0
From: [email protected]
To: $EMAIL_TO
Cc: $EMAIL_CC
Content-Type: text/html
Content-Disposition: inline
<html>
<head>
</head>
<body margin-top=24px margin-left=16px>
Hi All,<br>
<br>
內容
<br>
<br>
Thanks<br>
DW_ADM
<br>
</body>
</html>
EOF
6. 循環
for i in `ls`
do
echo $i
done
for ((i=0;i<=10;i++))
do
echo $i
done