1、查看inode的数量:df -i;
administrator@ubuntu:~$ df -i
文件系统 Inode 已用(I) 可用(I) 已用(I)% 挂载点
/dev/loop0 1136464 202028 934436 18% /
udev 215990 542 215448 1% /dev
tmpfs 219631 482 219149 1% /run
none 219631 3 219628 1% /run/lock
none 219631 7 219624 1% /run/shm
/dev/sda1 14165168 159579 14005589 2% /host
2、查看某一个文件的inode:
960420 study
3、显示所有文件节点:ls -ai;
administrator@ubuntu:~$ ls -ai
960250 . 961313 .gtk-bookmarks
915714 .. 1 .gvfs
960646 111111111111111111111 960645 h
960550 1.c 960644 hello
960544 1.c~ 960268 .ICEauthority
960624 2.c 1048747 .local
960627 2.c~ 960327 minicom.log
960326 .bash_history 960275 .mission-control
960252 .bash_logout 960281 .mozilla
960251 .bashrc 960254 .profile
918604 .cache 1048756 .pulse
960320 .compiz-1 960271 .pulse-cookie
960259 .config 960610 .shotwell
960264 .dbus 960420 study
960997 dev 960630 study~
961012 dev~ 960508 study1
960604 .dmrc 960999 study1.c
960253 examples.desktop 961019 study1.c~
1048750 .fontconfig 960637 study.c
1048729 .gconf 960551 test
960270 .gnome2 960564 test1
960992 .goutputstream-2CJM2Y 960319 .thumbnails
960307 .goutputstream-2FVY2Y 962106 u-boot-1.1.6_20100601.tar.bz2
961114 .goutputstream-4EWF5Y 961167 .wine
960618 .goutputstream-8D4K2Y 961093 .Xauthority
960567 .goutputstream-ANTS2Y 918618 .xsession-errors
960428 .goutputstream-FDCK3Y 918608 .xsession-errors.old
962247 .goutputstream-NXK54Y 957505 公共的
961887 .goutputstream-QQS24Y 954859 模板
960947 .goutputstream-SYTL2Y 960258 视频
960948 .goutputstream-TDL92Y 960257 图片
960647 .goutputstream-VTS44Y 960255 文档
961895 .goutputstream-X8PS5Y 918646 下载
962081 .goutputstream-YGO64Y 960256 音乐
960520 .gstreamer-0.10 918624 桌面
4、查看某分区的文件系统:
root@ubuntu:/home/administrator# blkid /dev/sda1
/dev/sda1: UUID="909065D89065C4F6" TYPE="ntfs"
5、查看某个文件的inode信息:
root@ubuntu:/home/administrator# stat study1.c
文件:"study1.c"
大小:262 块:8 IO 块:4096 普通文件
设备:700h/1792d Inode:960999 硬链接:1
权限:(0664/-rw-rw-r--) Uid:( 1000/administrator) Gid:( 1000/administrator)
最近访问:2017-09-17 10:02:47.081097432 +0800
最近更改:2017-08-14 01:02:58.997969315 +0800
最近改动:2017-08-14 01:02:59.169969313 +0800
创建时间:-
6、查看系统级别的最大打开文件数可以使用:
root@ubuntu:/home/administrator# sysctl -a | grep fs.file-max
error: permission denied on key 'vm.compact_memory'
error: "Invalid argument" reading key "fs.binfmt_misc.register"
fs.file-max = 197050
error: permission denied on key 'net.ipv4.route.flush'
error: permission denied on key 'net.ipv6.route.flush'
7、默认的进程打开文件上限是1024个,可以通过ulimit -n查看。
administrator@ubuntu:/var/log/cups$ ulimit -n1024