1. 程式人生 > 其它 >linux查詢大檔案,mysql查看錶大小和佔用的常用命令

linux查詢大檔案,mysql查看錶大小和佔用的常用命令

linux 查詢大檔案 :

find / -type f -size <檔案大小> -print0 | xargs -0 du -h

 find / -type f -size <檔案大小> -print0 | xargs -0 du -h

mysql 查看錶佔用大小:

SELECT

CONCAT( table_schema, '.', table_name ) AS 'Table Name',

CONCAT( ROUND( table_rows / 1000000, 4 ), 'M' ) AS 'Number of Rows',

CONCAT( ROUND( data_length / ( 1024 * 1024 * 1024 ), 4 ), 'G' ) AS 'Data Size',

CONCAT( ROUND( index_length / ( 1024 * 1024 * 1024 ), 4 ), 'G' ) AS 'Index Size',

CONCAT( ROUND( ( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 4 ), 'G' ) AS 'Total'

FROM

information_schema.TABLES

WHERE

table_schema LIKE <表名>