linux default directory

The following uses a table to list linux default directories or files and their uses:

 

directory/file use source
/ / is at the top of the Linux file system tree structure, it is the entry of the Linux file system, and all directories, files, and devices are under /. -
/bin This directory stores the most commonly used and important commands of the system, which are equivalent to the internal commands under DOS, but they exist in the form of independent files. For example: ls, cp, mkdir and other commands. The files in this directory are executable and commands that ordinary users can use. The most basic commands of the system are placed here. binary
/usr This directory is where the system stores programs, such as common commands, help files, installed software, and so on. There are many files and directories in this directory. When we install a package that is officially provided by a Linux distribution, it is mostly installed here. When there are configuration files involving the server, the configuration files are installed in the /etc directory. The /usr directory includes the font directory /usr/share/fonts, the help directory /usr/share/man or /usr/share/doc, etc.
unix shared resource
/where The content of this directory changes frequently. There is a /var/log directory under /var to store system logs. The /var/www directory is used to define the directory where the Apache server site is stored. /var/lib is used to store some library files. variable
/sbin Most of the commands related to system management are stored in this directory. It is the place where the executable commands of the super-privileged user root are stored. Ordinary users do not have permission to execute the commands in this directory. All commands contained in the directory sbin can only be performed by root. implemented. super user binary
/root The home directory of the root of the Linux super-privileged user (system administrator). -
/home The home directory of ordinary users is stored in this directory by default. For example, if a user is named wang, then its home directory is /home/wang, which can also be represented by ~wang. -
/etc This directory is the location of system configuration files, and some server configuration files are also here, such as user account and password configuration files. etcetera
/dev The device files are stored in this directory. This directory contains all Linux external device files. The functions of these device files are similar to .sys files under DOS and .vxd files under Win. Linux uses the device as a file, which abstracts the device, which greatly facilitates our operation and control of the device. So devices and files are accessed in the same way in Linux. device
/boot The files required by the Linux kernel and the program to boot the system are stored in this directory, such as vmlinuz, initrd.img and other files are located in this directory. In general, the GRUB or LILO system boot manager is in this directory. -
/opt This directory is an optional package installation directory, some packages we can install it in this directory. optional
/tmp This directory is used to store temporary files. Sometimes when the user runs the program, some temporary files will be generated. /tmp is used to store temporary files. The role of the /var/tmp directory and this directory is similar. temporary
/lost+found In the ext2 or ext3 file system, when the system crashes unexpectedly or the machine shuts down unexpectedly, some file fragments are stored in this directory. The fsck tool will check here when the system boots up and repair the corrupted filesystem. Sometimes there is a problem with the system, and many files are moved to this directory, which may be repaired manually, or moved to the original location of the files. -
/lib This directory is used to store library files. This directory stores the most basic shared library of the system, and its function is similar to the .dll file in Windows. Almost all applications need to use these shared libraries. library
/ mnt This directory is used to store the mount directory of the mounted storage device. The system provides this directory to allow users to temporarily mount other file systems, such as cdrom and other directories. mount
/proc When the operating system is running, process (running program) information and kernel information (such as cpu, hard disk partition, memory information, etc.) are stored here. The /proc directory is the mount directory of the fake file system proc, which is not a real file system. Therefore, this directory is a virtual directory, which is a mapping of system memory, and we can get system information by directly accessing this directory. That is, the contents of this directory are not on the hard disk but in memory. process
/misc 该目录可以用来存放杂项文件或目录,即那些用途或含义不明确的文件或目录可以存放在该目录下。 miscellany
/media 即插即用型存储设备的挂载点自动在该目录下创建。比如USB盘系统自动挂载后,会在这个目录下产生一个目录;CDROM/DVD自动挂载后,也会在这个目录中创建一个目录,类似于cdrom这个目录。该目录只有在最新的发行套件上才有。 -
/initrd 系统在启动前的内核是压缩的(这和ramdisk有关),当系统启动时需要解压缩,该目录就是解压缩时的临时目录,当启动完后又将该目录清空。 boot loader initialized RAM disk
/usr/man 该目录是Linux系统帮助文档的存放目录。 -
/proc/cpuinfo 关于处理器的信息,如类型、厂家、型号和性能等。比如cat /proc/cpuinfo - 
/proc/devices 当前运行内核所配置的所有设备清单。 -
/proc/filesystems 当前运行内核所配置的文件系统。 - 
/proc/dma 当前正在使用的DMA通道。 - 
/proc/interrupts 正在使用的中断和曾经有多少个中断。 -
/proc/ioports 当前正在使用的I/O端口。 - 
/etc/init.d 这个目录是用来存放系统或服务器以System V模式启动的脚本,这在以System V模式启动或初始化的系统中常见。比如RedHat Fedora。 - 
/etc/xinetd.d 如果服务器是通过xinetd模式运行的,它的脚本要放在这个目录下。有些系统没有这个目录,比如Slackware,有些老的版本也没有。在Redhat Fedora中比较新的版本中存在。 - 
/etc/rc.d 这是Slackware发行版中有的一个目录,是BSD方式启动脚本的存放地,比如定义网卡,服务器开启脚本等。 - 
/etc/X11 是X-Window相关的配置文件存放地。 -
/usr/bin 这个目录是可执行程序的目录,普通用户就有权限执行。当我们从系统自带的软件包安装一个程序时,他的可执行文件大多会放在这个目录。相似的目录是/usr/local/bin目录。有时/usr/bin中的文件是/usr/local/bin的链接文件。 - 
/usr/sbin 这个目录也是可执行程序的目录,但大多存放涉及系统管理的命令。只有root权限才能执行,相似目录是/sbin或/usr/local/sbin或/usr/X11R6/sbin等。 - 
/usr/local 这个目录一般是用来存放用户自编译安装软件的存放目录。一般是通过源码包安装的软件,如果没有特别指定安装目录的话,一般是安装在这个目录中。 - 
/usr/lib 该目录和/lib目录相似,是库文件的存储目录。存放一些常用的共享库。 - 
/usr/share 该目录用于存放系统共用的东西,比如/usr/share/fonts是字体目录,是用户都共用的。 - 
/usr/share/doc 该目录是Linux共享文档的存放地。 - 
/usr/share/man 该目录是共享的帮助文件的存放地。 - 
/usr/src 该目录是内核源码存放地,下面有内核源码目录,比如linux、linux-2.xxx.xx目录等。有的系统也会把一些源码软件包安装在这里,比如Redhat Fedora。另外Redhat 4.0/5.0,它的内核源码包的目录位于/usr/src/kernels目录下的某个目录中(只有安装后才会生成相应目录)。 -
/var/adm 比如软件包安装信息、日志、管理信息等就存放在该目录下,在Slackware操作系统中是有这个目录的。在Fedora中好象没有。 - 
/var/log 该目录用于存放系统日志。 - 
/var/spool 打印机、邮件、代理服务器等假脱机目录存放在该目录下。 - 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326432063&siteId=291194637