linux的一些基本命令

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:

administrator@ubuntu:~$ ls -i study
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 -n
1024







  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值