日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux文件目录分析之/etc目录

發(fā)布時間:2025/3/21 linux 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux文件目录分析之/etc目录 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
在linux下修改系統(tǒng)配置時就會在/etc這個目錄下修改配置文件,可見這個目錄是系統(tǒng)的配置文件目錄。

在終端輸入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
可以看到里面都是些系統(tǒng)配置文件,系統(tǒng)配置目錄,應用程序配置文件,應用程序配置目錄。

/etc/profile

系統(tǒng)全局環(huán)境變量設置,里面可以添加對所有用戶有效的環(huán)境變量,系統(tǒng)配置等。

$ 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的環(huán)境變量配置,里面添加啟動bash時讀取的環(huán)境。

$ 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命令讀取的系統(tǒng)庫目錄配置文件。

$ 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命令讀取的系統(tǒng)庫路徑生成的緩存文件。

/etc/timezone

系統(tǒng)的時間時區(qū)設置。

/etc/adduser.conf

添加的用戶信息。

/etc/deluser.conf

刪除用戶信息。

/etc/group

用戶組信息。

/etc/crontab

系統(tǒng)定時任務信息。

/etc/passwd

用戶密碼信息。

/etc/sudoers

具有sodu執(zhí)行權限的用戶信息。

/etc/protocols

系統(tǒng)支持的ip協(xié)議簇。

/etc/sysctl.conf

系統(tǒng)內核的配置文件。

$ 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目录的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。