Linux文件系统和目录

In this tutorial we will look details about Linux file system and directories. Linux stores binaries, files, images, libraries etc. in the file system for persistence. Ram is cleared between reboots but file system stays same if there is no change made intentionally.

在本教程中,我们将查看有关Linux文件系统和目录的详细信息。 Linux将二进制文件,文件,图像,库等存储在文件系统中以实现持久性。 两次重新启动之间会清除Ram,但如果没有有意进行更改,文件系统将保持不变。

根文件系统 (Root File System)

Linux file system hierarchy is leveled. So on the top of file system tree root path. All other files and directories are under this root path. For example if a usb is mounted which means connected to the Linux system it will exists generally in /media/<username>/<usb name> like /media/ismail/myusb . 

Linux文件系统层次结构已分级。 因此,在文件系统树根路径的顶部。 所有其他文件和目录都在此根路径下。 例如,如果安装了USB,则意味着已连接到Linux系统,它通常会存在于/ media / <用户名> / <usb名称>中,/ media / ismail / myusb。

文件 (File)

File is container for data like binary, image, text, dll etc. File have no child.We can list files like below

文件是二进制,图像,文本,dll等数据的容器。文件没有子级。我们可以列出以下文件

$ ls -l 
total 40 
-rw-rw-r-- 1 ismail ismail  253 Nov 13 18:25 mycommand 
drwxrwxr-- 3 ismail ismail 4096 Nov 13 15:59 output 
-rw-rw-r-- 1 ismail ismail 6350 Sep 20 14:51 percona-release_0.1-4.xenial_all.deb 
-rw-rw-r-- 1 ismail ismail 5127 Nov 13 12:03 pnggrad8rgb.jpg
  • Except output all of them are files

    除了输出都是文件

  • output is directory

    输出是目录

目录(Directory)

Directory hold files and child directories and used as holder for these items. Directory have no data.

目录保留文件和子目录,并用作这些项目的保留者。 目录没有数据。

$ ls -ld 
drwxr-xr-x 6 ismail ismail 4096 Nov 15 11:27 .

目录及其含义 (Directories and Their Meaning)

Where is binary files stored? How can I change some configuration of applications?  Where are my logs? We will look general usage of the directories

二进制文件存储在哪里? 如何更改应用程序的某些配置? 我的日志在哪里? 我们将查看目录的一般用法

  • root path and holds all other paths

    /根路径并保存所有其他路径

  • /usr , /bin user related binaries hold in these paths

    / usr,/ bin用户相关的二进制文件保存在这些路径中

  • /sbin administrator related paths are hold here

    / sbin管理员相关的路径在这里

  • /opt third party installed applications lays here

    / opt第三方安装的应用程序位于此处

  • /etc configuration files are hold here

    / etc配置文件保存在这里

  • /var/log log files are saved acording to their application

    / var / log日志文件根据其应用程序保存

  • /home user home directories and desktops are created here

    / home用户主目录和桌面在此处创建

  • /root ultimte administrator root’s home directory is here

    / root终极管理员root的主目录位于此处

  • /lib libraries requred to run applications

    / lib库需要运行应用程序

  • /media mount point for media like usb

    / media挂载点,用于USB等媒体

  • /mnt mount point for temporary mounted file systems

    / mnt挂载点,用于临时挂载的文件系统

  • /tmp temporary files

    / tmp临时文件

  • /var variable files like log, spool

    / var变量文件,例如日志,假脱机

  • /var/www web server apache2 default directory

    / var / www Web服务器apache2默认目录

LEARN MORE  How To Delete Empty, Nonempty Directory In Linux
了解更多如何在Linux中删除空的非空目录

翻译自: https://www.poftut.com/linux-file-system-and-directories/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值