当前位置: 首页 > news >正文

Linux 各个目录作用

刚毕业的时候学习Linux基础知识,发现了一份特别好的文档快乐的 Linux 命令行,翻译者是happypeter,作者当年也在慕课录制了react等前端相关的视频,通俗易懂,十分推荐

关于Linux的目录,多数博客已有详细介绍,这里仅仅是结合工作内容以及上文提到的文档做些许记录,供后续查阅使用
Linux file system

/opt

一般用于安装第三方的软件。比如开发的产品安装在客户机器上的目录即/opt

/tmp

一般用来存放临时文件,比如说可以把安装包上传到此目录,然后解压到opt

/bin

存放普通用户和系统管理员都可以使用的基本命令

/sbin

和bin一样,都是存放可执行的命令,但是人家全称叫System Binary,面向的是系统管理员

/etc

这个主要存放系统配置文件。关于这个/etc的来源,看了几个问题回答,比较可信的是:

I assure you that the original contents of /etc were the “et cetera” that didn’t seem to fit elsewhere. Other variants might do their own etymologies differently.
Regards,
Dennis

也就是说不知道放哪里了,就放这里吧,人家是co-creator of Unix,还是信得过的。

这个比较常用包括DNS的域名解析配置,用户最大进程数的配置,用户的环境变量等等

/home

/home 目录是专门为普通用户设计的目录,用来存放每个用户的个人数据和配置文件

/lib

做过Java开发的都知道需要的jar包也是在项目下的/lib,是类似的道理,只不过级别会高一些,是系统运行所需的核心共享库和内核模块的存放位置

The /lib directory contains kernel modules and those shared library images (the C programming code library) needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin. Libraries are readily identifiable through their filename extension of *.so. Windows equivalent to a shared library would be a DLL (dynamically linked library) file. They are essential for basic system functionality. Kernel modules (drivers) are in the subdirectory /lib/modules/‘kernel-version’. To ensure proper module compilation you should ensure that /lib/modules/‘kernel-version’/kernel/build points to /usr/src/‘kernel-version’ or ensure that the Makefile knows where the kernel source itself are located

参考

  • https://unix.stackexchange.com/questions/5665/what-does-etc-stand-for
  • https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/home.html
http://www.lryc.cn/news/495873.html

相关文章:

  • 【Linux】文件操作的艺术——从基础到精通
  • java中的运算符
  • 全面解析 C++ STL 中的 set 和 map
  • css:怎么设置div背景图的透明度为0.6不影响内部元素
  • Kubernetes ConfigMaps
  • 前端热门面试题目[一](HTML、CSS、Javascript、Node、Vue、React)
  • Swift 宏(Macro)入门趣谈(五)
  • ES6 Set、Map、WeakSet、WeakMap 四者辨析与实战应用详解
  • 【数据结构】哈希表实现
  • Verilog的线与类型与实例化模块
  • 芯片测试-RF中的S参数,return loss, VSWR,反射系数,插入损耗,隔离度等
  • 强化学习的几个主要方法(策略梯度、PPO、REINFORCE实现等)(上)
  • Git远程仓库操作
  • GAGAvatar: Generalizable and Animatable Gaussian Head Avatar 学习笔记
  • 什么是VISUAL STUDIO CODE (V S CODE)
  • 2024年09月中国电子学会青少年软件编程(Python)等级考试试卷(三级)答案 + 解析
  • C++初阶——动态内存管理
  • 如何查看阿里云ddos供给量
  • MySQL中的事务隔离全详解
  • 异常--C++
  • SeggisV1.0 遥感影像分割软件【源代码】讲解
  • 锁-读写锁-Swift
  • Kafka如何保证消息可靠?
  • 5.10【机器学习】
  • [白月黑羽]关于仿写股票数据软件题目的解答
  • 详解LZ4文件解压缩问题
  • vue项目中单独文件的js不存在this.$store?.state怎么办
  • Github提交Pull Request教程 Git基础扫盲(零基础易懂)
  • Java函数式编程【二】【Stream的装饰】【中间操作】【map映射器】【摊平映射器flatMap】
  • 树莓派明明安装了opencv和numpy,却找不到