·ChinaUnix首页 ·论坛 ·博客 
Linux首页 | Linux新闻 | Linux论坛 | Linux文档 | Linux下载 | Linux博客 | Linux搜索 | 开源项目孵化平台 | 《开源时代》
新手入门 | 安装启动 | 管理员指南 | 开发手册 | 桌面应用 | 程序开发 | 数据库 | 网络技术| CentOS | Fedora | MySQL | Apache | Ubuntu | Gentoo| OSCON08
  Linux时代 >> 技术文档 >> 系统管理
 
Linux中/proc目录下文件详解(三)
来源: ChinaUnix博客  日期: 2008.04.27 23:15 (共有条评论) 我要评论
 


声明:可以自由转载本文,但请务必保留本文的完整性。
作者:张子坚
email:zhangzijian@163.com
说明:本文所涉及示例均在fedora core3下得到。
---------------------------------------------------------------------------------------------------
/proc/net子目录
此目录下的文件描述或修改了联网代码的行为。可以通过使用arp,netstat,route和ipfwadm命令设置或查询这些特殊文件中的许多文件。
示例:
[root@localhost /]# ls /proc/net
anycast6       ip_conntrack         mcfilter6  rt6_stats     tcp
arp            ip_conntrack_expect  netlink    rt_acct       tcp6
dev            ip_mr_cache          netstat    rt_cache      udp
dev_mcast      ip_mr_vif            packet     snmp          udp6
dev_snmp6      ip_tables_matches    psched     snmp6         unix
if_inet6       ip_tables_names      raw        sockstat      wireless
igmp           ip_tables_targets    raw6       sockstat6
igmp6          ipv6_route           route      softnet_stat
ip6_flowlabel  mcfilter             rpc        stat
--------------------------------------------------------------------------------
以下摘要介绍此目录下文件的功能:
arp
转储每个网络接口的arp表中dev包的统计
dev
来自网络设备的统计
dev_mcast
列出二层(数据链路层)多播组
igmp
加入的IGMP多播组
netlink
netlink套接口的信息
netstat
网络流量的多种统计。第一行是信息头,带有每个变量的名称。接下来的一行保存相应变量的值
raw
原始套接口的套接口表
route
静态路由表
rpc
包含RPC信息的目录
rt_cache
路由缓冲
snmp
snmp agent的ip/icmp/tcp/udp协议统计;各行交替给出字段名和值
sockstat
列出使用的tcp/udp/raw/pac/syc_cookies的数量
tcp
TCP连接的套接口
udp
UDP连接的套接口表
unix
UNIX域套接口的套接口表
--------------------------------------------------------------------------------
示例:[root@localhost /]# cat /proc/net/route
Iface   Destination     Gateway         Flags   RefCnt  Use     Metric  Mask   MTU      Window  IRTT
eth0    0035C2DA        00000000        0001    0       0       0       80FFFFF0
eth0    0000FEA9        00000000        0001    0       0       0       0000FFF0
eth0    00000000        0135C2DA        0003    0       0       0       00000000
--------------------------------------------------------------------------------
[root@localhost /]# cat /proc/net/tcp
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode
   0: 00000000:8000 00000000:0000 0A 00000000:00000000 00:00000000 00000000    29        0 9525 1 0dde7500 3000 0 0 2 -1
   1: 00000000:006F 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0        0 9484 1 0dde79e0 3000 0 0 2 -1
   2: 0100007F:0277 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0        0 10049 1 0a8e3a00 3000 0 0 2 -1
   3: 0100007F:14D7 00000000:0000 0A 00000000:00000000 00:00000000 00000000    99        0 9847 1 0dde7020 3000 0 0 2 -1
   4: 0100007F:0019 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0        0 10286 1 0a8e3520 3000 0 0 2 -1
--------------------------------------------------------------------------------
[root@localhost /]# cat /proc/net/arp
IP address       HW type     Flags       HW address            Mask     Device
218.194.53.1     0x1         0x2         00:0D:BC:78:07:3F     *        eth0
--------------------------------------------------------------------------------
[root@localhost /]# cat /proc/net/udp
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode
   0: 00000000:8000 00000000:0000 07 00000000:00000000 00:00000000 00000000    29        0 9520 2 0b4ef7c0
105: 00000000:14E9 00000000:0000 07 00000000:00000000 00:00000000 00000000    99        0 10284 2 0b4ef040
111: 00000000:006F 00000000:0000 07 00000000:00000000 00:00000000 00000000 0        0 9483 2 0b4efcc0
116: 00000000:02F4 00000000:0000 07 00000000:00000000 00:00000000 00000000 0        0 9511 2 0b4efa40
119: 00000000:0277 00000000:0000 07 00000000:00000000 00:00000000 00000000 0        0 10050 2 0b4ef2c0
--------------------------------------------------------------------------------
/proc/scsi子目录
此目录下包含一个列出了所有检测到的SCSI设备的文件,并且为每种控制器驱动程序提供一个目录,在这个目录下又为已安装的此种控制器的每个实例提供一个子目录。
示例:
由于本人的机器没有SCSI设备,顾暂时无法提供示例。
--------------------------------------------------------------------------------
/proc/sys子目录
在此目录下有许多子目录。此目录中的许多项都可以用来调整系统的性能。这个目录包含信息太多,无法介绍全部。只在示例中展示目录下的一些文件。
示例:[root@localhost /]# ls /proc/sys
debug  dev  fs  kernel  net  proc  sunrpc  vm
--------------------------------------------------------------------------------
[root@localhost ~]# ls /proc/sys/fs
aio-max-nr   dentry-state       file-nr      lease-break-time  overflowgid
aio-nr       dir-notify-enable  inode-nr     leases-enable     overflowuid
binfmt_misc  file-max           inode-state  mqueue            quota
--------------------------------------------------------------------------------
[root@localhost ~]# ls /proc/sys/kernel
acct                   hotplug      panic                   sem
cad_pid                modprobe     panic_on_oops           shmall
cap-bound              msgmax       pid_max                 shmmax
core_pattern           msgmnb       print-fatal-signals     shmmni
core_uses_pid          msgmni       printk                  sysrq
ctrl-alt-del           ngroups_max  printk_ratelimit        tainted
domainname             osrelease    printk_ratelimit_burst  threads-max
exec-shield            ostype       pty                     vdso
exec-shield-randomize  overflowgid  random                  version
hostname               overflowuid  real-root-dev
--------------------------------------------------------------------------------
[root@localhost ~]# ls /proc/sys/net
core  ethernet  ipv4  ipv6  unix
--------------------------------------------------------------------------------
[root@localhost sys]# ls /proc/sys/vm
block_dump                 laptop_mode            nr_pdflush_threads
dirty_background_ratio     legacy_va_layout       overcommit_memory
dirty_expire_centisecs     lower_zone_protection  overcommit_ratio
dirty_ratio                max_map_count          page-cluster
dirty_writeback_centisecs  min_free_kbytes        swappiness
hugetlb_shm_group          nr_hugepages           vfs_cache_pressure
--------------------------------------------------------------------------------
[root@localhost sys]# ls /proc/sys/net/ipv4
conf                               tcp_fack
icmp_echo_ignore_all               tcp_fin_timeout
icmp_echo_ignore_broadcasts        tcp_frto
icmp_ignore_bogus_error_responses  tcp_keepalive_intvl
icmp_ratelimit                     tcp_keepalive_probes
icmp_ratemask                      tcp_keepalive_time
igmp_max_memberships               tcp_low_latency
igmp_max_msf                       tcp_max_orphans
inet_peer_gc_maxtime               tcp_max_syn_backlog
inet_peer_gc_mintime               tcp_max_tw_buckets
inet_peer_maxttl                   tcp_mem
inet_peer_minttl                   tcp_moderate_rcvbuf
inet_peer_threshold                tcp_no_metrics_save
ip_autoconfig                      tcp_orphan_retries
ip_conntrack_max                   tcp_reordering
ip_default_ttl                     tcp_retrans_collapse
ip_dynaddr                         tcp_retries1
ip_forward                         tcp_retries2
ipfrag_high_thresh                 tcp_rfc1337
ipfrag_low_thresh                  tcp_rmem
ipfrag_secret_interval             tcp_sack
ipfrag_time                        tcp_stdurg
ip_local_port_range                tcp_synack_retries
ip_nonlocal_bind                   tcp_syncookies
ip_no_pmtu_disc                    tcp_syn_retries
neigh                              tcp_timestamps
netfilter                          tcp_tso_win_divisor
route                              tcp_tw_recycle
tcp_abort_on_overflow              tcp_tw_reuse
tcp_adv_win_scale                  tcp_vegas_alpha
tcp_app_win                        tcp_vegas_beta
tcp_bic                            tcp_vegas_cong_avoid
tcp_bic_fast_convergence           tcp_vegas_gamma
tcp_bic_low_window                 tcp_westwood
tcp_dsack                          tcp_window_scaling
tcp_ecn                            tcp_wmem
--------------------------------------------------------------------------------
[root@localhost sys]# cat /proc/sys/kernel/shmall
2097152
--------------------------------------------------------------------------------
[root@localhost sys]# cat /proc/sys/kernel/osrelease
2.6.9-1.667
--------------------------------------------------------------------------------
总结:/proc文件系统包含了大量的有关当前系统状态的信息。proc的手册页中也有对这些文件的解释文档。把文件和分析这些文件的工具产生的输出进行比较能够更加清晰地了解这些文件。
本文出自 51CTO.COM技术博客


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/31/showart_602241.html
  发表评论 查看评论(共有条评论) 我要提问
 
 


最新资讯更多>> 
· 金山卫士开源计划首周源码下载..
· 谷歌劝说诺基亚采用Android操作..
· 11月份Linux市场占有率升至5%
· Apache 基金会确认退出 JCP 执..
· Chrome 10 新功能探秘:新增GP..
· 金山宣布开源其安全软件
· 开源FTP服务器ProFTPD发现后门
· 女黑客在开源会议上抱受骚扰
· 21款值得关注的Linux游戏
· 马化腾:腾讯半年后彻底转型,..
论坛热点更多>> 
· Linux系统移植从零开始!参与..
· 学习linux的意义在哪里
· 使用netfilter在哪能获取到原..
· 哥纠结了
· 一个在线读开源代码的工具,..
· 为什么我的目录下没有.cshrc..
· 初学linux从哪里开始
· linux 系统无法上网
· 新手安装UCenter 时总是出错..
· cacti添加主机显示的状态都是..
文档更新更多>> 
· 菜鸟入门三星ARM11嵌入式系统,是..
· 寻redhat 5.3 的中文手册 for ia64
· 请问redhat 5.3 企业版的用户手册..
· LINUX与UNIX SHELL编程指南(中文)
· 一些基本用户管理以及基本安装方法
· 菜鸟学习linux笔记与练习-----第..
· 菜鸟学习linux笔记与练习-----第..
· 服务器配置:Squid配置详解
· linux下u盘使用
· ubuntu dynamips 绑定网卡到虚拟机
 
关于我们 | 联系方式 | 广告合作 | 诚聘英才 | 网站地图 | 友情链接 | 免费注册

Copyright © 2001-2009 ChinaUnix.net All Rights Reserved

感谢所有关心和支持过ChinaUnix的朋友们

京ICP证:060528号