博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux file System directory
阅读量:4031 次
发布时间:2019-05-24

本文共 1847 字,大约阅读时间需要 6 分钟。

Similarly files are referred by file name, not by inode number. So what is the purpose of a directory? You can groups the files according to your usage. For example all configuration files are stored under /etc directory. So the purpose of a directory is to make a connection between file names and their associated inode number. Inside every directory you will find out two directories . (current directory) and .. (pointer to previous directory i.e. the directory immediately above the one I am in now). The .. appears in every directory except for the root directory.

Directory

A directory contained inside another directory is called a subdirectory. At the end the directories form a tree structure. Use tree command to see directory tree structure:
$ tree /etc | less
Again a directory has an inode just like a file. It is a specially formatted file containing records which associate each name with an inode number. Please note the following limitation of directories under ext2/3 file system:

  • There is an upper limit of 32768 subdirectories in a single directory.
  • There is a “soft” upper limit of about 10-15k files in a single directory

However according to official documentation of ext2/3 file system points that “Using a hashed directory index (which is under development) allows 100k-1M+ files in a single directory without performance problems’. Here are my two favorite alias commands related to directory :
$ alias ..='cd ..'
alias d='ls -l | grep -E "^d"'


Well I’m sure all of you know the basic commands related to directories and files managment. Click above (or here) to see summery of all basic commands related to directories and files managment. See interesting  about soft links and directories. This is 6th part of “Understanding  system, continue reading rest of the Understanding Linux file system series (this is part IV):

转载地址:http://zrhbi.baihongyu.com/

你可能感兴趣的文章
解析zookeeper的工作流程
查看>>
搞定Java面试中的数据结构问题
查看>>
深入理解Apache Flink核心技术
查看>>
SpringCloud 各组件原理图,面试必备
查看>>
面试题总结:可能是全网最好的MySQL重要知识点
查看>>
MySQL面试之数据库索引
查看>>
完整的项目管理流程,看清PMP42个过程的执行顺序
查看>>
设计模式,面试速记手册1
查看>>
设计模式,面试速记手册2
查看>>
备受面试官青睐的 Java NIO,到底和传统 IO 有啥不一样
查看>>
各大公司Java面试题超详细总结
查看>>
搞定MySQL之面经(一)
查看>>
排序算法,看这一篇就够了,含动图+Java实现
查看>>
性能指标:QPS、TPS、系统吞吐量理解
查看>>
搞清 适配器模式、代理模式和装饰者模式的不同
查看>>
一次完整的HTTP请求过程
查看>>
HTTP 与 HTTPS 的区别
查看>>
SVN E200030: There are unfinished transactions detected
查看>>
搞定Nginx高并发原理:多进程单线程和多路IO复用模型
查看>>
深入NGINX:nginx高性能的实现原理
查看>>