The Ubuntu's Directory Tree

本文详细解释了Ubuntu操作系统遵循的文件系统层次标准,并提供了关于如何合理分区的指导,确保系统的高效运行和资源优化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Ubuntu adheres to the Filesystem Hierarchy Standard for directory and file naming. This standard allows users and software programs to predict the location of files and directories. The root level directory is represented simply by the slash /. At the root level, all Ubuntu systems include these directories:

DirectoryContent
binEssential command binaries
bootStatic files of the boot loader
devDevice files
etcHost-specific system configuration
homeUser home directories
libEssential shared libraries and kernel modules
mediaContains mount points for replaceable media
mntMount point for mounting a file system temporarily
procVirtual directory for system information (2.4 and 2.6 kernels)
rootHome directory for the root user
sbinEssential system binaries
sysVirtual directory for system information (2.6 kernels)
tmpTemporary files
usrSecondary hierarchy
varVariable data
srvData for services provided by the system
optAdd-on application software packages

 

The following is a list of important considerations regarding directories and partitions. Note that disk usage varies widely given system configuration and specific usage patterns. The recommendations here are general guidelines and provide a starting point for partitioning.

  • The root partition / must always physically contain /etc/bin/sbin/lib and /dev, otherwise you won't be able to boot. Typically 150–250MB is needed for the root partition.

  • /usr: contains all user programs (/usr/bin), libraries (/usr/lib), documentation (/usr/share/doc), etc. This is the part of the file system that generally takes up most space. You should provide at least 500MB of disk space. This amount should be increased depending on the number and type of packages you plan to install. A standard Ubuntu desktop requires a minimum of 1.5GB here. A generous workstation or server installation should allow 4–6GB.

  • /var: variable data like news articles, e-mails, web sites, databases, the packaging system cache, etc. will be placed under this directory. The size of this directory depends greatly on the usage of your system, but for most people will be dictated by the package management tool's overhead. If you are going to do a full installation of just about everything Ubuntu has to offer, all in one session, setting aside 2 or 3 GB of space for /var should be sufficient. If you are going to install in pieces (that is to say, install services and utilities, followed by text stuff, then X, ...), you can get away with 300–500 MB. If hard drive space is at a premium and you don't plan on doing major system updates, you can get by with as little as 30 or 40 MB.

  • /tmp: temporary data created by programs will most likely go in this directory. 40–100MB should usually be enough. Some applications — including archive manipulators, CD/DVD authoring tools, and multimedia software — may use/tmp to temporarily store image files. If you plan to use such applications, you should adjust the space available in/tmp accordingly.

  • /home: every user will put his personal data into a subdirectory of this directory. Its size depends on how many users will be using the system and what files are to be stored in their directories. Depending on your planned usage you should reserve about 100MB for each user, but adapt this value to your needs. Reserve a lot more space if you plan to save a lot of multimedia files (pictures, MP3, movies) in your home directory.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值