Linux - Low space check

##################### low space : ################################

1. [root@app2 ~]# df -kh  :  (disk filesystem check which partition got low space : preferably user df -hP


2. [root@app2~]# df -hP /opt/Oracle/
Filesystem            Size  Used Avail Use% Mounted on
/dev/oracle_vg-oracle_lv   40G   32G  5.7G  85% /opt/Oracle
 

3. [root@app2 Oracle]# du -sck * | sort -n     (disk usage  - sck :  s is subfolder, k is size in 1024 bytes units)

OR  du -sck * --block-size=1GB | sort -n

4 lost+found
5942460 em12c-media
27139136 em12c
33081600 total


4. File deleting/Cleanup
User following command to find and remove files
1)  ls -tr | head -n 1   -- check the oldest file
 find ./ -name  '*.txt' -mtime +XX    --- modified more than XX days ago
 find ./ -name  '*' -mtime +40 | wc -l
 find ./ -name  '*' -mtime +40 -exec rm -rf {} \;    --- delete files are modified 40 days ago

 find ./ -name  '*' -mtime +40 | wc -l

5. delete the content of a file: 

A easiest way to empty or blank a file content using shell redirect null (non-existent object) to the file as below:


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值