linux目录整理

1、

[root@XM ~]# cat /etc/redhat-release   ##显示系统版本信息
CentOS Linux release 7.0.1406 (Core)

2、

[root@XM ~]# runlevel  ##显示当前系统运行级别
N 3

3、
[root@XM ~]# cat /etc/inittab  ##查看当前系统运行级别的配置文件

4、

[root@XM ~]# echo $LANG    ##显示系统字符集
en_US.UTF-8

[root@NGINX-Y ~]# cat /etc/sysconfig/i18n  ##查看系统字符集配置文件也可vim修改

LANG="en_US.UTF-8"

SYSFONT="latarcyrheb-sun16"

 5、

[root@XM ~]# ll /usr/local/  ##存放用户自编译安装软件的存放目录;编译软件的默认路径,yum或rpm包按照默认路径一般不是这里了
total 44
drwxr-xr-x 6 root root 4096 Sep 18 2018 aegis
drwxr-xr-x. 2 root root 4096 Jun 10 2014 bin
drwxr-xr-x. 2 root root 4096 Jun 10 2014 etc
drwxr-xr-x. 2 root root 4096 Jun 10 2014 games
drwxr-xr-x. 2 root root 4096 Jun 10 2014 include
drwxr-xr-x. 2 root root 4096 Jun 10 2014 lib
drwxr-xr-x. 2 root root 4096 Jun 10 2014 lib64
drwxr-xr-x. 2 root root 4096 Jun 10 2014 libexec
drwxr-xr-x. 2 root root 4096 Jun 10 2014 sbin
drwxr-xr-x. 6 root root 4096 Sep 13 2018 share
drwxr-xr-x. 2 root root 4096 Jun 10 2014 src

6、

[root@XM ~]# ll /opt/   ##用于存放第三方厂商开发的程序,表示的是可选择的意思,有些软件包也会被安装在这里,也就是自定义软件包,我们自己编译的软件包,就可以安装在这个目录中;通过源码包安装的软件,可以通过./configure --prefix=/opt/目录。
total 4
drwxr-xr-x. 2 root root 4096 Oct 29 2014 rh

7、

[root@XM ~]# ll -d /home/  ##
drwxr-xr-x. 3 root root 4096 Sep 14 2018 /home/

8、

/bin   ##二进制命令的目录,普通用户命令的目录

9、

/boot  ##启动过程及引导

10、

/dev  ##设备文件的目录(声卡、光驱)

11、

/etc   ##配置文件的目录(二进制软件包)

12、

/etc/fstab  ##开机自动挂载设备的配置文件

13、

[root@XM ~]# cat /etc/motd  ##登录后的信息

Welcome to aliyun Elastic Compute Service!

14、

/lib  ##库文件存放目录

15、

/lost+found  ##在ext3文件系统中,当系统意外崩溃或机器意外关机,会产生一些文件碎片在这里,当系统在开机启动的过程中fsck工具会检查这里,并修复已经损坏的文件系统。当系统发生问题,可能会有文件被移到这个目录中,可能需要用手工的方式来修复,或移到文件到原来的位置上。

16、

/mnt   ##用于临时挂载存储设备的目录

17、

/proc  ##操作系统运行时,进程信息及内核信息(比如CPU、硬盘分区、内存信息等)存放在这里。/proc 目录伪装的文件系统proc的挂载目录,proc并不是真正的文件系统

18、

/proc/meminfo  ##磁盘的信息

19、

/proc/mounts   ##磁盘的挂载信息

20、

/sbin   ##超级用户命令的目录,通过sudo让普通用户执行

21、

/tmp  ##临时文件目录,有时用户运行程序的时候,会产生临时文件。/tmp就用来存放临时文件的,权限比较特殊。/var/tmp 目录和这个目录相似

22、

/usr   ##这个是系统存放程序的目录(比如命令、帮助文件等)

23、

/var   ##这个目录是经常变动的

24、

/var/log  ##用来存放系统日志的目录

25、

/var/log/messages  ##系统日志的路径

26、

/var/log/secure    ##用户登录信息日志,依赖于rsyglog服务开启

27、

etc/sysconfig/network-scripts/ifcfg-eth0  ##配置eth0网卡

/etc/init.d/network restart  ##重启所有网卡

ifdown eth0 && ifup eth0## 重启eth0网卡

[root@oldboyedu-01]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 ##eth0配置网卡路径
DEVICE=eth0 ##网卡的名字
HWADDR=00:0c:29:a8:a4:2f ##硬件地址,MAC地址
TYPE=Ethernet ##类型 互联网
UUID=9de1d9a8-12dd-49d8-8070-54e6248e0839 ##UUID 系统中唯一的标识
ONBOOT=yes ##在启动的时候是否开启网卡(自动运行)
NM_CONTROLLED=yes ##是否能被network软件进行管理
BOOTPROTO=none ##网卡获取ip地址的方式;#none/static 静态ip,DHCP 自动获取ip地址
IPADDR=10.0.0.200 ##ip地址
NETMASK=255.255.255.0 ##子网掩码
GATEWAY=10.0.0.2 ##网关
USERCTL=no ##是否准许普通用户管理网卡 开 关 重启
PEERDNS=yes ##如是yes默认
IPV6INIT=no
DNS1=223.5.5.5
DNS2=223.6.6.6

28、

/etc/resolv.conf   ##DNS配置文件

29、

/etc/hosts   ##设定用户IP与名字(或域名)的对应解析表,相当于本地LAN局域网内的DNS

30、

/etc/sysconfig/network   ##可修改主机名及网卡启动,网关等配置

31、

/etc/inittab      ##查看启动级别也可修改

#   0 - halt (Do NOT set initdefault to this)  ##关机模式

#   1 - Single user mode  ##单用户模式

#   2 - Multiuser, without NFS (The same as 3, if you do not have networking) ## 没有NFS的,多用户模式

#   3 - Full multiuser mode ##命令行模式

#   4 - unused ##没有使用

#   5 - X11 ##X11桌面

#   6 - reboot (Do NOT set initdefault to this) ##重启模式

 32、

/etc/init.d/iptables   ##linux 防火墙

[root@XM ~]# /etc/init.d/iptables stop   ##临时关闭防火墙

iptables: Setting chains to policy ACCEPT: filter       [  OK  ]

iptables: Flushing firewall rules:                      [  OK  ]

iptables: Unloading modules:                            [  OK  ]

[root@XM ~]# /etc/init.d/iptables status   ##查看防火墙的状态

Table: filter

Chain INPUT (policy ACCEPT)

num  target     prot opt source               destination        

Chain FORWARD (policy ACCEPT)

num  target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)

num  target     prot opt source  

[root@XM ~]# chkconfig iptables off   ##在自启动服务中永久关闭防火墙

33、

/etc/fstab   ##实现开机要挂载的文件系统的配置文件

34、

/etc/rc.local  ##用于存放开机自启动程序命令的文件

35、

/etc/exports   ##设定NFS网络文件系统用的配置文件

36、

 /etc/init.d  ##这个目录是用来存放系统或服务器通过yum或rpm工具安装的软件的默认启动程序的目录

37、

/etc/profile  ##系统全局变量永久生效的配置文件。定义别名以及PATH变量等

38、

/etc/profile.d   ##加载系统登录程序的目录,命令或文件独立存在!以文件的形式存在(.sh为扩展名)但要可执行

39、

/etc/group   ##设定用户的组名与相关信息

/etc/passwd  ##账号信息文件

/etc/shadow   ##密码信息文件

40、

 /etc/motd  ##显示(设置)登录后的通告

原文地址:https://www.cnblogs.com/Confusedren/p/9735909.html