Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15456151
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: LINUX

2009-06-18 11:46:36

显示内核信息
luther@gliethttp:~$ uname -a

显示当前加载了的模块
luther@gliethttp:~$ lsmod

显示pc所有硬件配置信息
luther@gliethttp:~$ lshw

显示系统pci硬件信息
luther@gliethttp:~$ lspci

显示连接到usb-hub上的所有设备信息
luther@gliethttp:~$ lsusb

显示硬盘,u盘分区信息
luther@gliethttp:~$ sudo fdisk -l

显示磁盘使用情况信息
luther@gliethttp:~$ df -h
luther@gliethttp:~$ df -h / 显示根目录磁盘使用信息

显示当前文件夹占用空间情况
luther@gliethttp:~$ du -sh /vobs/dbus

显示硬盘全部信息
luther@gliethttp:~$ sudo hdparm -i /dev/sda

显示cpu信息
luther@gliethttp:~$ cat /proc/cpuinfo

显示机器信息
luther@gliethttp:~$ dmesg

显示当前内存使用信息
luther@gliethttp:~$ free -m
luther@gliethttp:~$ free -m -s 1 每隔1秒动态显示

显示该进程打开的文件
luther@gliethttp:~$ lsof -p pid

显示所有使用unix通信的程序
luther@gliethttp:~$ lsof -U

显示deb安装包包含的内容
luther@gliethttp:/var/cache/apt/archives$ dpkg -c sysstat_8.1.2-2ubuntu1_i386.deb

显示磁盘负载﹑cpu和进程pid负载信息
luther@gliethttp:~$ sudo apt-get install sysstat
luther@gliethttp:/var/cache/apt/archives$ dpkg -c sysstat_8.1.2-2ubuntu1_i386.deb
一共5个bin文件
/usr/bin/sadf
/usr/bin/iostat
/usr/bin/mpstat
/usr/bin/pidstat
/usr/bin/sar.sysstat
luther@gliethttp:~$ iostat 1 // 每1描显示一次磁盘使用情况

显示网络通信状况
luther@gliethttp:~$ netstat
luther@gliethttp:~$ netstat -n // 显示所有unix通信程序
luther@gliethttp:~$ netstat -s // 查看网络统计信息

显示所有使用ipv4和ipv6通信的程序
luther@gliethttp:~$ lsof -i

显示当前监听80号端口的程序
luther@gliethttp:~$ lsof -i :80

显示指定ip机器的MAC地址
luther@gliethttp:~$ arping 192.168.23.1

显示进程启动过程中发生的所有系统调用
luther@gliethttp:~$ strace /usr/bin/ssh 127.0.0.1

显示系统共享内存﹑共享信号量以及共享队列
luther@gliethttp:~$ ipcs
luther@gliethttp:~$ ipcs -m // 只显示共享内存
luther@gliethttp:~$ ipcs -s // 只显示共享信号量

删除系统共享内存﹑共享信号量以及共享队列
luther@gliethttp:~$ ipcrm -m mem_id // 删除mem_id对应的内存共享区
luther@gliethttp:~$ ipcrm -s sem_id // 删除sem_id对应的信号量共享区

查看系统环境变量
luther@gliethttp:~$ env

查看当前使用的字符集
luther@gliethttp:~$ locale

立即生效.bashrc等shell脚本
luther@gliethttp:~$ . .bashrc // 使用.点操作,或者使用source

前提是必须有sensors传感器
luther@gliethttp:~$ sudo su
root@gliethttp:/home/luther# apt-get install lm-sensors
luther@gliethttp:~$ sudo sensors-detect
也可以添加applet到面板
luther@gliethttp:~$ sudo apt-get install sensors-applet // 然后添加"Hardware Sensors Monitor到面板上

硬盘温度检测
luther@gliethttp:~$ sudo apt-get install hddtemp
luther@gliethttp:~$ sudo hddtemp /dev/sda
/dev/sda: ST3160815AS: 36°C

显示硬盘所有信息工具
luther@gliethttp:~$ sudo apt-get install smartmontools
luther@gliethttp:~$ sudo smartctl --all /dev/sda

AMD处理器降温软件
luther@gliethttp:~$ sudo apt-get install athcool

手工动态设置ip,dns和gateway网关
luther@gliethttp:~$ sudo vim /etc/resolv.conf
nameserver 202.106.0.20
luther@gliethttp:~$ sudo ifconfig eth0 192.168.23.23 netmask 255.255.255.0 up
luther@gliethttp:~$ sudo route add default gw 192.168.23.1 eth0
luther@gliethttp:~$ sudo service networking restart

手工静态永久设置ip,dns和gateway网关
luther@gliethttp:~$ sudo vim /etc/resolv.conf
nameserver 202.106.0.20
luther@gliethttp:~$ sudo vim /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.23.23
netmask 255.255.255.0
gateway 192.168.23.1
luther@gliethttp:~$ sudo service networking restart

luther@gliethttp:~$ vmstat -a 1 999999999999999
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free  inact active   si   so    bi    bo   in   cs us sy id wa
 0  0      0 268840 214036 391852    0    0     0     0  843 4326 30  2 68  0
 0  0      0 268824 214036 391852    0    0     0    24  564 2653 11  2 86  0
 0  0      0 268756 214036 392320    0    0     0    96  654 4453 15  2 83  0
 0  0      0 268692 214036 392364    0    0     0     0  636 3928 13  3 84  0
 1  0      0 268660 214052 392300    0    0     0     0  897 2267 35  3 62  0
 0  0      0 268732 214052 392368    0    0     0     0  964 2128 42  2 55  0
 0  0      0 268780 214052 392368    0    0     0     0  765 1867 33  2 65  0
 0  0      0 268724 214052 392368    0    0     0    44  647 2505 15  2 83  0
转自:http://blog.csdn.net/etune/archive/2009/05/05/4151715.aspx
process
    r 为置于运行队列的内核线程数目
    b为置于等待对列的内核线程数目
cache
    free  : the amount of free physical memory (in KB by default)
    buff  : the amount of memory consumed by buffers (in KB by default)
    inact : the amount of memory on the inactive list (in KB by default)
    active: the amount of memory on the active list (in KB by default)
swap
    si: 从磁盘写出的物理页总数(in KB/s by default)
    so: 写入磁盘的物理页总数(in KB/s by default)
io
    bi: 从磁盘获取的数据块总数 (in blocks/s).
    bo: 写入磁盘的数据块总数 (in blocks/s).
system
    in: the number of interrupts received (in interrupts/s)
    cs: the number of context switches (in switches/s)
cpu
    us: 用户空间消耗的cpu百分比
    sy: 内黑消耗的cpu百分比
    wa: i/o等待的cpu百分比
    id: 空闲时间的百分比


http://hi.baidu.com/zheng918/blog/item/636948903cfd1a89a877a408.html

1. 系统/文件/网络
df -lh 查看磁盘的使用情况以及文件系统被挂载的位置
fdisk -l 查看磁盘分区表及分区结构
stat display file or filesystem status
uname                                 "什么系统",-r "查看内核版本"
du                                       "查看文件占用空间"
dmesg                                       "系统信息"
netstat                               "由于参数众多,不一一详细写,端口

信息"
2. 用户
w Show who is logged on and what they are doing.
useradd username "添加用户" -G 组名 username "直接将用户加到组并创建"
userdel username "删除用户" -r username "连用户的目录也删除"
passwd username "添加密码"
passwd -l username "锁密码"
passwd -u username "解开密码"
passwd -d username "删除密码"
id username "查看用户信息"
usermod -l new_username old_username "用户改名"
usermod -G 组名 username "更改组"
usermod -L username "锁顶用户"
usermod -U username "激活用户"
groupadd 组名 "创建组"
gpassswd -a username 组名 "将用户添加到组"
groupmod -n new_group old_group "组改名"
groupdel 组名 "删除组"
gpasswd 组名 "改变组密码"
gpasswd -r 组名 "删除组密码"

cat /proc/cpuinfo - CPU (i.e. vendor, Mhz, flags like mmx)
cat /proc/interrupts - 中断
cat /proc/ioports - 设备IO端口
cat /proc/meminfo - 内存信息(i.e. mem used, free, swap size)
cat /proc/partitions - 所有设备的所有分区
cat /proc/pci - PCI设备的信息
cat /proc/swaps - 所有Swap分区的信息
cat /proc/version - Linux的版本号 相当于 uname -r
uname -a - 看系统内核等信息




阅读(2230) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~