我读过William Shotts的Linux命令行,并且有一些linux文件的描述(系统目录)
“/var
目录内容不会改变。这棵树就在哪里
存储可能改变的数据。各种数据库,
假脱机文件,用户邮件等都位于此处。“
我感兴趣的是,如果/var
目录内容没有改变,为什么在安装`apache-php``后www
中存在/var/www
文件夹。
/var/www
文件夹是我们必须编辑,创建或删除文件的地方,这是一个localhost公共目录,你能给我回答吗?为什么他说,/var
目录内容不会改变。
答案 0 :(得分:19)
/var
的描述是自相矛盾的。 /var
包含易于更改的内容,例如网站,临时文件(/var/tmp
)和数据库。该名称是“变量”的缩写。
答案 1 :(得分:6)
Linux File-system Hierarchy Standard和Linux Standard Base给出了预期可用的各种文件(包括目录)的定义。 /var hierarchy
包含可变数据文件。这包括假脱机目录和文件,管理和日志记录数据以及临时和临时文件。
有趣的是/var/www/
未在此类规范性规范中定义。
答案 2 :(得分:5)
男子hier
/var This directory contains files which may change in size, such as spool and log files.
/var/account
Process accounting logs (optional).
/var/adm
This directory is superseded by /var/log and should be a symbolic link to /var/log.
/var/backups
Reserved for historical reasons.
/var/cache
Data cached for programs.
/var/cache/fonts
Locally-generated fonts (optional).
/var/cache/man
Locally-formatted man pages (optional).
/var/cache/www
WWW proxy or cache data (optional).
/var/cache/<package>
Package specific cache data (optional).
/var/catman/cat[1-9] or /var/cache/man/cat[1-9]
These directories contain preformatted manual pages according to their man page section. (The use of preformatted manual pages is deprecated.)
/var/crash
System crash dumps (optional).
/var/cron
Reserved for historical reasons.
/var/games
Variable game data (optional).
/var/lib
Variable state information for programs.
/var/lib/hwclock
State directory for hwclock (optional).
/var/lib/misc
Miscellaneous state data.
/var/lib/xdm
X display manager variable data (optional).
/var/lib/<editor>
Editor backup files and state (optional).
/var/lib/<name>
These directories must be used for all distribution packaging support.
/var/lib/<package>
State data for packages and subsystems (optional).
/var/lib/<pkgtool>
Packaging support files (optional).
/var/local
Variable data for /usr/local.
/var/lock
Lock files are placed in this directory. The naming convention for device lock files is LCK..<device> where <device> is the device's name in the filesystem. The format used is that of HDU
UUCP lock files, that is, lock files contain a PID as a 10-byte ASCII decimal number, followed by a newline character.
/var/log
Miscellaneous log files.
/var/opt
Variable data for /opt.
/var/mail
Users' mailboxes. Replaces /var/spool/mail.
/var/msgs
Reserved for historical reasons.
/var/preserve
Reserved for historical reasons.
/var/run
Run-time variable files, like files holding process identifiers (PIDs) and logged user information (utmp). Files in this directory are usually cleared when the system boots.
/var/spool
Spooled (or queued) files for various programs.
/var/spool
Spooled (or queued) files for various programs.
/var/spool/at
Spooled jobs for at(1).
/var/spool/cron
Spooled jobs for cron(8).
/var/spool/lpd
Spooled files for printing (optional).
/var/spool/lpd/printer
Spools for a specific printer (optional).
/var/spool/mail
Replaced by /var/mail.
/var/spool/mqueue
Queued outgoing mail (optional).
/var/spool/news
Spool directory for news (optional).
/var/spool/rwho
Spooled files for rwhod(8) (optional).
/var/spool/smail
Spooled files for the smail(1) mail delivery program.
/var/spool/uucp
Spooled files for uucp(1) (optional).
/var/tmp
Like /tmp, this directory holds temporary files stored for an unspecified duration.
/var/yp
Database files for NIS, formerly known as the Sun Yellow Pages (YP).
答案 3 :(得分:-5)
我会说/ var中的内容不会经常改变 。 根据我的经验,它主要用于存储数据库文件,缓存文件,当然还有/ var / www目录。 这些对象确实发生了变化,但例如,网站不会每秒都发生变化。