2017年 07月 18日 - linux磁盘满时,如何定位并删除文件

    问题

    服务器的磁盘被占满,需要排查是什么文件占用的

    解决

    使用如下命令列出各个文件(夹)所占大小:

    $ sudo -i
    # df -h
    # cd /
    # du -shx *
    
    du -h --max-depth=1 /data
    # 磁盘空间占用与排序
    du -h --max-depth=1 /data/logs/apps/|sort -hr
    

    2017年 07月 13日 - widows下文件夹包含空格解决

    问题

    windows下创建包含空格的文件夹,可以正常创建,但是保存文件进去时,会提示FileNotFoundException

    解决

    对包含空格的进行url编码

    2017年 07月 07日 - linux查看内存

    ps

    实时的显示各个进程的内存使用情况. Reported memory usage information includes %MEM (percent of physical memory used), VSZ (total amount of virtual memory used), and RSS (total amount of physical memory used). 你可以使用 “–sort”选项对进程进行排序,例如按RSS进行排序:

    $ ps aux --sort -rss
    

    /proc/meminfo 跟 free -h

    一个快速查看内存使用情况的方法,它是对 /proc/meminfo 收集到的信息的一个概述

    $ cat /proc/meminfo
    $ free -h