2008年11月25日 星期二

Solaris Command

Finding Large Directories

to output the 10 largest directories in /var, sorted in ascending size order, use the following command:

  • du -ko /var|sort -n |tail -10
  • du -kod /var|sort -n |tail -10

Finding Large Files

1. Example 1: To find all plain files (not block, character, symbolic links, and so on) in a file system larger than 200,000 512-byte blocks (approximately 100 Mbytes) and sort on field 7 (file size) while numerically ignoring leading blanks, do this:

  • find / -size +200000 -type f -ls |sort -k 7,7 -n

2. To find all plain files (not block, character, symbolic links, and so on) in a /var file system larger than 1,000 512-byte blocks (approximately 500 Kbytes) and sort on field 7 (file size) while numerically ignoring leading blanks, do this:

  • find /var -size +1000 -type f -ls |sort -k 7,7 -n

沒有留言: