Linux 各个目录作用

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

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

/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

参考

相关推荐
翼龙云_cloud4 分钟前
阿里云渠道商:新手怎么操作阿里云无影云电脑?
运维·服务器·阿里云·云计算·电脑
拾忆,想起42 分钟前
Dubbo服务调用流程全解析:从请求到响应的微服务通信之旅
服务器·网络·微服务·云原生·架构·dubbo
回忆是昨天里的海1 小时前
docker存储-目录挂载
运维·docker·容器
永不停歇的蜗牛1 小时前
Maven的POM文件相关标签作用
服务器·前端·maven
爱吃萝卜的美羊羊1 小时前
ubuntu下国内升级ollama
linux·运维·ubuntu
Erwin Rommel5591 小时前
nginx的https服务搭建实验
服务器·nginx·https
mzhan0172 小时前
Linux: console: printk: console_no_auto_verbose
linux·运维·服务器
用什么都重名2 小时前
Docker 镜像源配置指南
运维·docker·容器
河南博为智能科技有限公司2 小时前
高集成度国产八串口联网服务器:工业级多设备联网解决方案
大数据·运维·服务器·数据库·人工智能·物联网
Savvy..2 小时前
天机学堂-Day01
linux·服务器·网络