Linux directory structure - upper

Chapter 1 Directory Structure

1.1 Directory Structure Features

Tree upside down
everything from the root
everything is a file

1.2 Directory Structure

/bin            二进制文件  命令
/sbin           超级命令只有root用户可以使用
/boot           引导文件系统内核
/dev            设备文件光盘 硬盘分区
/etc            系统配置文件
/home           普通用户的家目录
/root           超级用户的家目录
/lib            lib库文件
/lib64          lib库文件
/lost+found     临时保存数据
/mnt            临时挂载点
/opt            第三方软件安装位置
/proc           虚拟目录存放内存中的信息 进程 服务信息
/sys            虚拟目录存放内存中的信息 进程 服务信息
/tmp            临时存储文件
/usr            用户安装
/var            存放日志

 
image.png

Under 1.3 / proc directory need to know

1.3.1 /proc/cpuinfo

Cpu information system

[root@nfsnobody ~]# cat /proc/cpuinfo                  一般常用的是  lscpu
processor   :0 第几个核心  此处表示第一个
vendor_id   :GenuineIntel
cpu family  :6
model       :60
model name  :Intel(R) Core(TM) i5-4200H CPU @ 2.80GHz
stepping    :3
microcode   :34
cpu MHz     :2793.547
cache size  :3072 KB
physical id :0第几颗CPU(物理) 此处表示第一个
###以下还有信息 但是不常用 不再显示
cat /proc/cpuinfo一般常用的是  lscpu
[root@nfsnobody ~]# lscpu  查看cpu的信息

1.3.2 /proc/meminfo                                 

System Memory Information

[root@nfsnobody ~]# cat /proc/meminfo
可以查看内存的信息  信息过长 此处不粘贴详细内容
cat /proc/meminfo  一般用 free -h代替           
-h使free显示的内容可读
total一共    used  使用   free  剩余
[root@nfsnobody ~]# free -h  查看内存信息    -h参数 使free显示的内容可读
total       used       freeshared    buffers     cached
Mem:980M       619M       360M       228K        51M       397M
-/+ buffers/cache:       170M       809M
Swap:767M         0B       767M

1.3.3 /proc/mounts

Information system mounts

[root@nfsnobody ~]# cat /proc/mounts
用cat /proc/mounts  信息显示很杂乱  一般用column -t  /proc/mounts代替
[root@nfsnobody ~]# column -t  /proc/mounts ##使文件信息对齐后显示

 

Chapter 2 mount

2.1.1 What is the Mount

Linux can mount each directory on different devices (disk)
Windows is not easy to do
Linux all devices (CD-ROM disk) can not be used without the mount
all the following Linux devices by default can not be used directly

2.2 Mounting Methods

1, the optical disc placed on the host (the virtual machine image file is added) is inserted into the optical disk system
2, a mount to mount the directory

[root@nfsnobody ~]# ls -l /dev/cdrom 
lrwxrwxrwx. 1 root root 3 Jul 10 18:30 /dev/cdrom-> sr0
###现在不能直接查看这个文件

To create a CD entry (entry must already exist)
entry === ==== mount point directory (already existing)

[root@nfsnobody ~]# mount /dev/cdrom /mnt/   挂载
mount: block device /dev/sr0 is write-protected,mounting read-only
[root@nfsnobody ~]# ls -l /mnt/

2.2.1 FHS standard directory hierarchy

Hierarchy Standard FHS directory (/ and / the role of each directory)

http://www.pathname.com/fhs/pub/fhs-2.3.html

Guess you like

Origin www.cnblogs.com/wenrulaogou/p/11982015.html