• linux 命令小结(随时更新)


    代码备份命令:

    tar cvf 备份文件名 要备份的目录名

    查看Linux服务器内存使用情况:

    1、free命令

    free -m

    [root@localhost ~]# free -m
                total       used       free     shared    buffers     cached
    Mem:          1526        182       1344          0         16         99
    -/+ buffers/cache:         65       1460
    Swap:         3071          0       3071

    很清晰明白的显示出了总内存多少,已使用多少,还剩下多少。

    2、top命令

    top命令中的显示结果中有这样两行:

    Mem:   1563088k total,   186784k used,  1376304k free,    17444k buffers
    Swap:  3145720k total,        0k used,  3145720k free,   101980k cached

    这个也很明白了吧,只是说它是以k为单位显示出来的。

    3、vmstat命令

    [root@localhost ~]# vmstat
    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
    r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
    0  0      0 1376320  17452 101980    0    0     1     1    4    5  0  0 100  0  0

    4.[root@localhost ~]# ifconfig;

    [admin@localhost ~]$ ifconfig;
    eth0 Link encap:Ethernet HWaddr 00:0C:29:99:2F:B9
    inet addr:192.168.119.129 Bcast:192.168.119.255 Mask:255.255.255.0
    inet6 addr: fe80::20c:29ff:fe99:2fb9/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:33 errors:0 dropped:0 overruns:0 frame:0
    TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:11795 (11.5 KiB) TX bytes:4549 (4.4 KiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:8 errors:0 dropped:0 overruns:0 frame:0
    TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:480 (480.0 b) TX bytes:480 (480.0 b)

    获取当前设备的网络接口配置信息,还能够修改这些配置;

    5.查看所有已安装的软件包:

    # rpm -qa # 查看所有安装的软件包

    备注:以上命令基于Linux centOS6.5 系统

  • 相关阅读:
    python字符串相关的函数
    令人惊奇的gdb和pstack
    map的正确删除方式
    论道
    自动锁
    delete数组引发的core分析
    linux_硬链接和软链接区别
    vmware的卸载
    vmware + opensuse windows如何远程登录到suse上
    [置顶]援引个人新浪博客
  • 原文地址:https://www.cnblogs.com/wangzhao2016/p/5604437.html
Copyright © 2020-2023  润新知