在linux下修改系统配置时就会在/etc这个目录下修改配置文件,可见这个目录是系统的配置文件目录。

在终端输入ls看看里面的文件:

$ ls
acpi                    calendar             dpkg           host.conf             ldaptor         magic.mime      os-release               rc2.d          shells        udev
adduser.conf            chatscripts          drirc          hostname              ldapvi.conf     mailcap         overlayroot.conf         rc3.d          signond.conf  udisks2
alternatives            console-setup        emacs          hosts                 ld.so.cache     mailcap.order   pam.conf                 rc4.d          skel          ufw
apache2                 cpu                  environment    hosts.allow           ld.so.conf      manpath.config  pam.d                    rc5.d          sos.conf      updatedb.conf
apg.conf                cracklib             ffserver.conf  hosts.deny            ld.so.conf.d    mdadm           papersize                rc6.d          sound         update-manager
apm                     cron.d               fonts          ImageMagick-6         legal           memcached.conf  passwd                   rc.local       ssh           update-motd.d
apparmor                cron.daily           fstab          init                  libao.conf      mime.types      passwd-                  rcS.d          ssl           update-notifier
apparmor.d              cron.hourly          fuse.conf      init.d                libaudit.conf   mke2fs.conf     perl                     resolvconf     subgid        UPower
apport                  cron.monthly         gai.conf       initramfs-tools       libnl-3         modprobe.d      php                      resolv.conf    subgid-       upstart-xsessions
apt                     crontab              gconf          inputrc               libpaper.d      modules         pki                      rmt            subuid        usb_modeswitch.conf
at.deny                 cron.weekly          gdb            insserv               lightdm         modules-load.d  pm                       rpc            subuid-       vdpau_wrapper.cfg
at-spi2                 crypttab             ghostscript    insserv.conf          lighttpd        mongodb.conf    polkit-1                 rsyslog.conf   subversion    vim
auth-client-config      cupshelpers          gnome          insserv.conf.d        lintianrc       mtab            popularity-contest.conf  rsyslog.d      sudoers       vmware-tools
avahi                   dbus-1               gnome-vfs-2.0  iproute2              locale.alias    mysql           ppp                      samba          sudoers.d     vtrgb
bash.bashrc             dconf                GNUstep        iscsi                 locale.gen      nanorc          profile                  sane.d         supervisor    vulkan
bash_completion         debconf.conf         groff          issue                 localtime       network         profile.d                screenrc       sysctl.conf   wgetrc
bash_completion.d       debian_version       group          issue.net             logcheck        NetworkManager  protocols                securetty      sysctl.d      wpa_supplicant
bind                    default              group-         java-8-openjdk        login.defs      networks        pulse                    security       sysstat       X11
bindresvport.blacklist  deluser.conf         grub.d         kbd                   logrotate.conf  newt            python                   selinux        systemd       xdg
binfmt.d                depmod.d             gshadow        kernel                logrotate.d     nsswitch.conf   python2.7                sensors3.conf  terminfo      xml
bluetooth               dhcp                 gshadow-       kernel-img.conf       lsb-release     nvcc.profile    python3                  sensors.d      texmf         zsh_command_not_found
bonobo-activation       dictionaries-common  gss            ldap                  ltrace.conf     openal          python3.5                services       thermald
byobu                   dkms                 gtk-2.0        ldap-account-manager  lvm             OpenCL          rarfiles.lst             sgml           timezone
ca-certificates         dnsmasq.d            gtk-3.0        ldap.conf             machine-id      openmpi         rc0.d                    shadow         tmpfiles.d
ca-certificates.conf    docker               hdparm.conf    ldapscripts           magic           opt             rc1.d                    shadow-        ucf.conf

可以看到里面都是些系统配置文件,系统配置目录,应用程序配置文件,应用程序配置目录。

/etc/profile

系统全局环境变量设置,里面可以添加对所有用户有效的环境变量,系统配置等。

$ cat profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).if [ "$PS1" ]; thenif [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then# The file bash.bashrc already sets the default PS1.# PS1='\h:\w\$ 'if [ -f /etc/bash.bashrc ]; then. /etc/bash.bashrcfielseif [ "`id -u`" -eq 0 ]; thenPS1='# 'elsePS1='$ 'fifi
fiif [ -d /etc/profile.d ]; thenfor i in /etc/profile.d/*.sh; doif [ -r $i ]; then. $ifidoneunset i
fi

/etc/bash.bashrc

bash的环境变量配置,里面添加启动bash时读取的环境。

$ cat bash.bashrc
# System-wide .bashrc file for interactive bash(1) shells.# To enable the settings / commands in this file for login shells as well,
# this file has to be sourced in /etc/profile.# If not running interactively, don't do anything
[ -z "$PS1" ] && return# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; thendebian_chroot=$(cat /etc/debian_chroot)
fi# set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '# Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
#    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
#    ;;
#*)
#    ;;
#esac# enable bash completion in interactive shells
#if ! shopt -oq posix; then
#  if [ -f /usr/share/bash-completion/bash_completion ]; then
#    . /usr/share/bash-completion/bash_completion
#  elif [ -f /etc/bash_completion ]; then
#    . /etc/bash_completion
#  fi
#fi# sudo hint
if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; thencase " $(groups) " in *\ admin\ *|*\ sudo\ *)if [ -x /usr/bin/sudo ]; thencat <<-EOFTo run a command as administrator (user "root"), use "sudo <command>".See "man sudo_root" for details.EOFfiesac
fi# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; thenfunction command_not_found_handle {# check because c-n-f could've been removed in the meantimeif [ -x /usr/lib/command-not-found ]; then/usr/lib/command-not-found -- "$1"return $?elif [ -x /usr/share/command-not-found/command-not-found ]; then/usr/share/command-not-found/command-not-found -- "$1"return $?elseprintf "%s: command not found\n" "$1" >&2return 127fi}
fi

/etc/hosts

主机域名的配置。

$ cat hosts
127.0.0.1       localhost
127.0.1.1       ubuntu# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters192.168.2.22  Master
192.168.2.23  Backup
192.168.2.61  vedio1
192.168.2.62  vedio2

/etc/ld.so.cof

ldconfig命令读取的系统库目录配置文件。

$ cat  ld.so.conf
include /etc/ld.so.conf.d/*.conf
/usr/local/cuda-8.0/lib64
/usr/local/samba/lib

/etc/ld.so.cache

ldconfig命令读取的系统库路径生成的缓存文件。

/etc/timezone

系统的时间时区设置。

/etc/adduser.conf

添加的用户信息。

/etc/deluser.conf

删除用户信息。

/etc/group

用户组信息。

/etc/crontab

系统定时任务信息。

/etc/passwd

用户密码信息。

/etc/sudoers

具有sodu执行权限的用户信息。

/etc/protocols

系统支持的ip协议簇。

/etc/sysctl.conf

系统内核的配置文件。

$ cat sysctl.conf
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
##kernel.domainname = example.com# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3##############################################################3
# Functions previously found in netbase
## Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#

参考链接: http://blog.csdn.net/rig622/article/details/7591419

linux文件目录分析之/etc目录相关推荐

  1. 链接文件配置(linux文件目录指向另一个目录,ln -s的用法)

    一.遇到问题 前几天被交接了一个十几年前的老系统,同事让帮忙发版,这是一个使用tomcat启一个mvc的单体项目:我想尽管很久不使用这个东西了,应该简单呀,无非就是上传一个war包或者编译文件,然后重 ...

  2. 孟宁的Linux内核分析,Linux内核分析-MOOC小结

    Linux内核分析课程小结 目录: 在学习内核时一定要不断动手实验,才能更好的理解内核中的运作,之后才能学以致用. Linux内核分析(孟宁老师)课件列表: 短短几周过去了,但是内核学习却才开始... ...

  3. linux进入probe目录,Linux基础学习系列——Linux文件目录操作命令

    Linux文件目录操作命令 工作目录切换命令 pwd命令 cd命令 ls命令 文件目录管理命令 touch命令 mkdir命令 cp命令 mv命令 rm命令 dd命令 file命令 pwd命令 pwd ...

  4. linux 没有那个文件或目录_基于CentOS8Linux运维教程-Linux文件目录管理笔记

    Linux文件目录结构及用途 文件目录增删改查 vim编辑器使用技巧 准备工作: 虚拟机 root登录系统 打开终端 操作技巧 方向键 上下键可以查看历史的命令 tab键 自动补齐命令及参数 取消命令 ...

  5. linux目录默认权限是什么,linux文件目录默认权限(详解)

    1.文件的默认权限是没有x的,即文件的最大默认权限为666(-rw-rw-rw) 2.由于进入目录和目录的x权限有关,故目录的最大默认权限为777(drwxrwxrwx) 查看默认权限需要使用umas ...

  6. linux系统下nginx安装目录和nginx.conf配置文件目录

    linux系统下nginx安装目录和nginx.conf配置文件目录 1.查看nginx安装目录 输入命令 # ps  -ef | grep nginx 返回结果包含安装目录 root      26 ...

  7. linux文件目录操作实验报告,Linux操作系统实验4文件和目录操作

    <Linux操作系统>课程实验报告 实验4 文件和目录操作 一.实验目的 1.理解Linux文件系统的结构和目录组织方式: 2.掌握Linux常用目录和文件命令的使用. 二.实验内容与要求 ...

  8. linux 文件目录操作,Linux系统下文件与目录操作

    与其它操作系统一样,在Linux系统下用户的数据和程序也是以文件的形式保存的.所以在使用Linux的过程中,是经常要对文件与目录进行操作的.现在我们就以一个Window用户的立场来学习一下Linux下 ...

  9. linux 内核 核心代码,8分钟掌握Linux内核分析的核心科技

    原标题:8分钟掌握Linux内核分析的核心科技 作者: OUYANG_LINUX007 来源: http://blog.csdn.net/ouyang_linux007/article/details ...

最新文章

  1. powerdesigner中类图的内部类画法
  2. 利用计算机模拟人类的感知,利用计算机模拟人类的智能活动,属于计算机的什么应用领域...
  3. javascript和“主流大型语言”(c# JAVA C++等)的差异
  4. 【每周NLP论文推荐】 知识图谱重要论文介绍
  5. pat 乙级 1033 旧键盘打字(C++)
  6. Freeswitch NAT问题
  7. 京东抢购机器人_戴森、科沃斯、SKG...超多大牌低价秒杀!京东电器等你来
  8. 第十四届华中科技大学程序设计竞赛--J Various Tree
  9. 垃圾回收机制,是不是这样理解?
  10. c++ opengl 三维图形中显示文字_opengl基本流程
  11. python入门书?
  12. java 规范 阿里巴巴_阿里巴巴 Java 代码规范
  13. SCCM 客户端PXE 启动 卡boot.sdi
  14. 开源项目——小Q聊天机器人V1.1
  15. VR全景为家装赋能,沉浸式体验家装设计效果
  16. Could not publish server configuration for Tomcat v8.0 Server at localhost.
  17. 神经网络是部署到终端还是服务器的
  18. 4G图传移动视频取证-可视安全生产监管-常见问题解答FAQ
  19. 三体船的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告
  20. Hbuilder-应用程序打包

热门文章

  1. 数据结构实验之栈与队列七:出栈序列判定
  2. 第七天2017/04/14(引用与const、C++基本知识)
  3. CNN(Convolutional Neural Networks)没有原理只有实现
  4. 打造高效的工作环境 – SHELL 篇
  5. java提高篇(十二)-----代码块
  6. Spring松耦合的实现
  7. 基于 Jenkins 快速搭建持续集成环境
  8. 在Chrome 中调试Javascript
  9. Java并发编程(2):线程中断(含代码)
  10. SIFT中LoG和DoG比较