目录层次表准FHS

FHS(Filesystem Hierarchy standard)

FHS定义两层规范:1、“/”目录下的各个目录应该放什么文件数据

         2、针对/usr /var两个目录的子目录来定义

目录         说明
/bin
(Essential user command Binaries (for use all useres)),常用二进制命令所在的目录。比如ls、cp、mkdir、rm、cut等命令;/bin目录和/usr/bin类似
[root@lxy ~]# which cat
/bin/cat
[root@lxy ~]# which mkdir
/bin/mkdir
cat ---->concatenate files and print on the standard output
chgrp ---->change group ownership
chmod ---->change file mode bit
chown ---->change file owner and group
cp ---->copy files and directories
date ----> print or set the system date and time
dd ---->convert and copy a file
df ---->report file system disk space usage
dmesg ---->print or control the kernel ring buffer
echo ---->display a line of text
false ---->do nothing, unsuccessfully
hostname---->show or set the system’s host name
kill ---->kill sends the specified signal to the specified process or
process group.
ln ---->make links between files
login ---->begin a session on the system
ls ---->list directory contents
mkdir ---->make directories
mknod ---->make block or character special files
mount ---->mount a filesystem
mv ---->move (rename) files
ps ---->report a snapshot of the current processes.
pwd ---->print name of current/working directory
rm ---->remove files or directories
rmdir ---->remove empty directories
sed ---->stream editor for filtering and transforming text
sh ---->GNU Bourne-Again SHell
stty ---->change and print terminal line settings
su ---->run a shell with substitute user and group IDs
sync ---->flush file system buffers
true ---->do nothing, successfully
umonut ---->unmount file systems
uname ---->print system information
/boot
(static files of the boot loader)Linux的内核及引导系统程序所需的文件目录。安装系统分区的时候一般要分一个boot分区。常见分区:/boot 128M swap内存的1.5倍 /全给。The operating system kernel must be located in either /or /boot
[root@lxy ~]# ll /boot/
total 24866
-rw-r--r--. 1 root root 106308 Oct 15 2014 config-2.6.32-504.el6.x86_64
drwxr-xr-x. 3 root root 1024 Jan 6 13:09 efi
drwxr-xr-x. 2 root root 1024 Jan 6 13:10 grub
-rw-------. 1 root root 18433397 Jan 6 13:10 initramfs-2.6.32-504.el6.x86_64.img
drwx------. 2 root root 12288 Jan 6 13:07 lost+found
-rw-r--r--. 1 root root 200191 Oct 15 2014 symvers-2.6.32-504.el6.x86_64.gz
-rw-r--r--. 1 root root 2544748 Oct 15 2014 System.map-2.6.32-504.el6.x86_64
-rwxr-xr-x. 1 root root 4152336 Oct 15 2014 vmlinuz-2.6.32-504.el6.x86_64
/dev
(Device files)设备文件的目录,比如声卡、磁盘、光驱……。
/dev/null
清空文件的方法
Cat /dev/null >文件
All data written to this device is discarded.A read from this device will return an EOF condition.
/dev/zero
This device is a source of zerod out data.All data written to this device is discarded.A read from this.
/dev/tty
This device is a synonym for the controlling terminal of a process.Once this device
/etc
(HOST-specific system configuration)
二进制安装包(yum,rpm)的配置文件默认路径
exports ---->NFS filesystem access control list(optional)
fstab ---->Static information about filesystems(optional)
hosts ---->Static information about host names(optional)
inittab ---->Configuration file for init(optional)
issue ---->Pre-login message and identification file(optional)
ld.so.conf ---->List of extra directories to search for shared libraries(optional)
motd ---->Post-login message of the day file(optional)
networks ---->Static information about network names(optional)
passwd ---->The password file(optional)
profile ---->Systemwide initialization file for sh shell logins(optional)
resolv.conf ---->Resolves configuration file(optional)
services ---->Port names for network services(optional)
syslog.conf ---->Configuration file for syslogd(optional)
服务启动命令存放的目录/etc/init.d(yum,rpm)
[lxy@lxy ~]$ ls -l /etc/init.d/
total 176
-rwxr-xr-x. 1 root root 3580 Oct 15 2014 auditd
-r-xr-xr-x. 1 root root 1340 Oct 15 2014 blk-availability
-rwxr-xr-x. 1 root root 2826 Nov 23 2013 crond
-rw-r--r--. 1 root root 19295 Jul 22 2014 functions
-rwxr-xr-x. 1 root root 5866 Jul 22 2014 halt
-rwxr-xr-x. 1 root root 2001 Oct 16 2014 htcacheclean
-rwxr-xr-x. 1 root root 3371 Oct 16 2014 httpd
-rwxr-xr-x. 1 root root 10804 Oct 15 2014 ip6tables
-rwxr-xr-x. 1 root root 10688 Oct 15 2014 iptables
-rwxr-xr-x. 1 root root 19476 Oct 15 2014 kdump
-rwxr-xr-x. 1 root root 652 Jul 22 2014 killall
-r-xr-xr-x. 1 root root 2134 Oct 15 2014 lvm2-lvmetad
-r-xr-xr-x. 1 root root 2757 Oct 15 2014 lvm2-monitor
-rwxr-xr-x. 1 root root 2571 Sep 4 2014 mdmonitor
-rwxr-xr-x. 1 root root 2989 Jul 22 2014 netconsole
-rwxr-xr-x. 1 root root 6064 Jul 22 2014 netfs
-rwxr-xr-x. 1 root root 6334 Jul 22 2014 network
-rwxr-xr-x. 1 root root 1923 Jul 15 2013 ntpd
-rwxr-xr-x. 1 root root 2043 Jul 15 2013 ntpdate
-rwxr-xr-x. 1 root root 3912 Feb 20 2014 postfix
-rwxr-xr-x. 1 root root 1513 Sep 17 2013 rdisc
-rwxr-xr-x. 1 root root 1822 Oct 15 2014 restorecond
-rwxr-xr-x. 1 root root 2011 Aug 15 2013 rsyslog
-rwxr-xr-x. 1 root root 1698 Oct 15 2014 sandbox
-rwxr-xr-x. 1 root root 2056 Jun 23 2014 saslauthd
-rwxr-xr-x. 1 root root 647 Jul 22 2014 single
-rwxr-xr-x. 1 root root 4621 Oct 15 2014 sshd
-rwxr-xr-x. 1 root root 2294 Oct 15 2014 udev-post
/home
(User home directories(optional)普通用户的家目录默认数据存放目录。
/lib
(Essential shared libraries and kernel modules)库文件存放目录
The /lib directory contains those shared library images needed to boot the system and run the commands in the root filesystem,ie.by binaries in /bin and /sbin
[root@lxy ~]# ls -ld /lib
lrwxrwxrwx. 1 root root 7 Dec 12 12:36 /lib -> usr/lib
[root@lxy ~]# ls -ld /lib64
lrwxrwxrwx. 1 root root 9 Dec 12 12:36 /lib64 -> usr/lib64
/lost+found
在ext3文件系统中,当系统意外崩溃或机器意外关机,会产生一些文件碎片在这里。当系统在开机启动的过程中fsck工具会检查这里,并修复已经损坏的文件系统。当系统发生问题,可能会有文件被移到这个目录中,可能需要手动的方式来修复,或移到文件原来的位置上
/mnt
(Mount point for mounting a filesystem temporarily)一般使用于临时挂载存储设备的挂载目录的,比如cdrom,U盘等目录。直接插入光驱无法使用,要先挂载后使用。
/opt(option)
(Add-on application software packages)表示的是可选择的意思,有些软件包也会被安装在这里,也就是自定义软件包,我们自己编译的软件包,就可以安装在这个目录中;通过源码包安装的软件,可以通过./configure –prefix=/opt/目录,非必须这样,视习惯或规范而定。
/proc
Kernel and process information virtual filesystem
操纵系统运行时,进程信息及内核信息(比如cpu、硬盘分区、内存信息等)存放在这里。/proc目录伪装的文件系统proc的挂载目录,proc并不是真正的文件系统,它的定义可以参见/etc/fstab
cat /proc/meminfo
cat /proc/cpuinfo
cat /proc/loadavg
/sbin
(Essential system binaries)大多数是涉及系统管理的命令的存放,是超级权限用户root的可执行命令存放地,这个目录和/usr/sbin;/usrX11R6/sbin或/usr/local/sbin目录是相似的;
Command Description
fdisk ---->Partition table manipulator(optional)
fsck ---->File system check and repair utility(optional)
halt ---->Command to stop the system(optional)
ifconfig ---->Configure a network interface(optional)
init ---->Initial process(optional)
mkfs ---->Command to build a filesystem(optional)
mkfs.* ---->Command to build a specific filesystem(optional)
mkswap ---->Command to set up a swap area(optional)
reboot ---->Command to reboot the system(optional)
route ---->IP routing table utility(optional)
swapon ---->Enable paging and swapping(optional)
swapoff ---->Disable paging and swapping(optional)
/tmp
(Temporary files)临时文件目录,有时用户运行程序的时候,会产生临时文件。/tmp就用来存放临时文件的,权限比较特殊。/usr/vat/tmp目录和这个目录相似。
/usr
(Secondary hierarchy)这是个系统存放程序的目录,比如命令、帮助文件等。这个目录下有很多的文件和目录。当我们安装一个Linux发行版官方提供的软件包时,大多数安装在这里。
/usr/bin ---->Most user commands用户可执行文件目录
/usr/include ---->Header files included by C Programs程序的头文件存放目录
/usr/lib ---->Libraries
/usr/local ---->Local hierarchy(empty after main installation)
/usr/sbin ---->Non-vital system binaries
/usr/share ---->Architecture-independent data
/usr/share/fonts---->字体目录
/usr/share/man---->帮助目录
/usr/share/doc---->文档目录
/usr/src:Source code(optional)源码目录
/var
(Variable data)这个目录的内容是经常变动的,看名字就知道,我们可以理解为vary的缩写,/var下有/var/log这是用来存放系统日志的目录,系统日志路径/var/log/messages。/var/www目录是定义Apache服务站点存放目录;/var/lib用来存放一些库文件,比如MySQL的,以及MySQL数据库的存放地;
/var/log/messages ---->system messages from syslogd(系统日志文件)
/var/log/secure ---->
/var/spool/cron ---->定时任务的配置文件路径

Linux各目录的意义的更多相关文章

  1. linux中权限对文件和目录的意义

    1.权限对文件的意义: 读:可查看文件的内容 写:可修改文件的内容(但不能删除文件) 执行:可执行文件 2.权限对目录的意义: 读:可以查看目录下的内容,即可以读取该目录下的结构列表 写:可修改目录下 ...

  2. Linux标准目录

    本文参考鸟哥的linux私房菜 /bin 获得最小的系统可操作性所需要的命令 /boot 内核和加载内核所需要的文件 /dev 终端.磁盘.调制解调器等的设备项 /etc 关键的启动文件和配置文件 / ...

  3. 64个命令,每天一个linux命令目录, shutdown,tee,rcp,

    每天一个linux命令目录 开始详细系统的学习linux常用命令,坚持每天一个命令,所以这个系列为每天一个linux命令.学习的主要参考资料为: 1.<鸟哥的linux私房菜> 2.htt ...

  4. [转帖]linux /proc目录下的文件为何无法用vi编辑保存

    linux /proc目录下的文件为何无法用vi编辑保存 https://blog.51cto.com/xlogin/1216914 学习一下 之前看过书 这一点 没太仔细看.. xlogin关注8人 ...

  5. Linux各目录及每个目录的详细介绍总结

    Linux各目录及每个目录的详细介绍 [常见目录说明] 目录 /bin 存放二进制可执行文件(ls,cat,mkdir等),常用命令一般都在这里. /etc 存放系统管理和配置文件 /home 存放所 ...

  6. Linux /dev目录详解和Linux系统各个目录的作用

    Linux /dev目录详解(转http://blog.csdn.net/maopig/article/details/7195048) 在linux下,/dev目录是很重要的,各种设备都在下面.下面 ...

  7. Linux的目录结构

    学习Linux这么久,对Linux的目录的目录结构进行整理总结一下. 以下是对这些目录的解释: /bin:bin是Binary的缩写, 这个目录存放着最经常使用的命令. /boot:这里存放的是启动L ...

  8. Linux 标准目录结构

    初学Linux,首先需要弄清Linux 标准目录结构 / root --- 启动Linux时使用的一些核心文件.如操作系统内核.引导程序Grub等. home --- 存储普通用户的个人文件 ftp ...

  9. linux 查询目录下包含关键字的所有文件

    linux查找目录下的所有文件中是否含有某个字符串 查找目录下的所有文件中是否含有某个字符串 find .|xargs grep -ri "IBM" 查找目录下的所有文件中是否含有 ...

随机推荐

  1. openlayers4 入门开发系列结合 echarts4 实现散点图(附源码下载)

    前言 openlayers4 官网的 api 文档介绍地址 openlayers4 api,里面详细的介绍 openlayers4 各个类的介绍,还有就是在线例子:openlayers4 官网在线例子 ...

  2. vuex简单使用。

    项目结构: 1:首先在项目中新建store.js文件,.js文件内容如下: import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) ex ...

  3. CoderForces985F-Isomorphic Strings

    F. Isomorphic Strings time limit per test 3 seconds memory limit per test 256 megabytes input standa ...

  4. 从零开始的openGL——四、纹理贴图与n次B样条曲线

    前言 在上篇文章中,介绍了如何加载绘制模型以及鼠标交互的实现,并且遗留了个问题,就是没有模型表面没有纹理,看起来很丑.这篇文章将介绍如何贴纹理,以及曲线的绘制. 纹理贴图 纹理加载 既然是贴图,那首先 ...

  5. Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'

    在webpack的管理输出的部分,设定HtmlWebpackPlugin部分,运行npm run build 会报错 Error: Cannot find module 'webpack/lib/no ...

  6. CCF-CSP题解 201503-3 节日

    模拟题. 良心出题人并没有\(y_1>y_2\)的样例.注意闰年的处理. #include <bits/stdc++.h> using namespace std; int dayO ...

  7. CSRF与auth模块

    目录 一.模拟实现中间件的编程思想 (一)impotlib模块 (二)实现功能的配置使用 二.跨站请求伪造CSRF (一)由来 (二)form表单的CSRF (三)ajax中的CSRF (1)通过da ...

  8. let和const总结(ES6)

    文章目录 let const 1. let要好好用 1. 基本用法 2. let声明的变量不存在变量提升 3. TDZ(temporal dead zone)暂时性死区 4. 不允许重复声明 2. 块 ...

  9. C# WPF抽屉效果实现(C# WPF Material Design UI: Navigation Drawer & PopUp Menu)

    时间如流水,只能流去不流回! 点赞再看,养成习惯,这是您给我创作的动力! 本文 Dotnet9 https://dotnet9.com 已收录,站长乐于分享dotnet相关技术,比如Winform.W ...

  10. ShowDoc速记

    编写文档好工具showdoc部署 参考:https://www.showdoc.cc/ 一定要看,一定要用卷,丢失数据的痛苦,痛何如哉. https://www.cnblogs.com/harrych ...