linux view file size

 

 

 

In the first few days, the company got solr and specified the target directory of the index library to a memory-mapped /tmp/memdir with a size of 80G.

As the index is continuously written, /tmp/memdir is not enough, and the solr service will hang after solr writes to this directory, so

A linux command is required to view directory usage:

 

  du:    Summarize disk usage per file

[root@hadoop3 ~]# du --help
Usage: du [OPTION]... [FILE]...
  or:  du [OPTION]... --files0-from=F
Summarize disk usage of each FILE, recursively for directories.

 

 eg:

    du -h directory A means that humans can see the form display and do not summarize at this time

    du -sh directory A means summing up directory A and the sum of the files below

 

     The following command shows the occupied space of solr storage data disk

 

  du disk usage show usage size

[root@hadoop3 ~]# du -h stu
4.0K stu
[root@hadoop3 ~]# du -h zhongshu
140K    zhongshu/table_hbase/secondary_index/conf_20141106
172K    zhongshu/table_hbase/secondary_index
180K    zhongshu/table_hbase
8.0K    zhongshu/table_hive
264K zhongshu
[root@hadoop3 ~]# du -sh zhongshu
264K zhongshu

 

 

If you want to see disk mounts and usage, use df

 

[root@hadoop3 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        19G   11G  7.4G  58% /
tmpfs           937M  228K  937M   1% /dev/shm
/dev/sda1       283M   33M  236M  13% /boot

 

The two df du are somewhat similar, du associates the word disk usage with what it does, so it shows a single file size

Then df is showing mount and overall disk usage ratio.

 

du -sh

you h

df -h

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326671953&siteId=291194637