|
楼主 |
发表于 2003-4-16 00:32:23
|
显示全部楼层
那个${2##/*/}是用来取出单独的目录名的....
我现在的教本只能达到下面的效果...前提是参数用相对路径 ../
- #!/bin/sh
- du $1 --max-depth=1 | sort -n|awk '{printf "%7.2fM ----> %s\n",$1/1024,$2}'
复制代码
0.00M ----> ../sharin
0.00M ----> ../test11
0.01M ----> ../hacktest
0.01M ----> ../jon163
0.05M ----> ../truly
0.18M ----> ../images
0.80M ----> ../zend
0.96M ----> ../coolbee
1.66M ----> ../dh
2.98M ----> ../sea
3.87M ----> ../mu
3.99M ----> ../believeu
4.18M ----> ../manual
4.19M ----> ../mwwdb
8.27M ----> ../lool
9.52M ----> ../viva
9.73M ----> ../4image
10.41M ----> ../cg
10.51M ----> ../youxia
11.03M ----> ../coconut
11.75M ----> ../hyd
14.02M ----> ../lksj
15.41M ----> ../knighte
16.04M ----> ../caxinfo
17.55M ----> ../frecky
22.62M ----> ../boredom
29.09M ----> ../web
30.79M ----> ../ayachina
34.53M ----> ../ck
37.71M ----> ../51js
47.97M ----> ../chinairun
55.12M ----> ../lpt
58.53M ----> ../lucyyork
58.72M ----> ../huix
58.86M ----> ../handsomepig
66.23M ----> ../GXD
69.53M ----> ../hydxd
70.09M ----> ../51pyc
71.57M ----> ../sammi
72.38M ----> ../xingzhe
76.79M ----> ../tempshare
81.10M ----> ../h2o
87.08M ----> ../ourak
93.03M ----> ../eacbbs
96.20M ----> ../joe
103.30M ----> ../yuwen
108.94M ----> ../netpc
215.89M ----> ../green
1859.22M ----> ../ww
3662.45M ----> .. |
|