The role of Linux directories and related files (confusing edition) for beginners

Source: Internet
Author: User
Tags dmesg

/etc/profile file
When a user logs on to a Linux system or uses the SU command to switch to another user, that is, the login shell starts with a guarantee that the startup script executed is/etc/profile

?
?
/etc/profile.d
Now you know the effect is OK Bar command to modify color settings, etc.
?


?
The/etc/profile script is only run when the login shell is started, and the Non-login shell does not invoke this script
Path: The search path for the preset executable file or command.
User: The username used when the user logs on.
LOGNAME: The value is $user.
HOSTNAME: The host name used.
Mail: The mailbox that holds the user's e-mail (in fact an ASCII code file).
Histsize: The number of rows in the history record.
INPUTRC: The information that is stored for the keyboard hotkey (also an ASCII code file).
?
Note that the variable set in the/etc/profile file is a global variable.
?
?


?
/etc/profile.d
This directory holds the startup scripts that are required for some applications. Some additional settings include colors, language Vim,whick, and other commands
These script files can be executed automatically. This is because/etc/profile uses a For loop statement to invoke these scripts. And these scripts are used to set up some variables and run some initialization process
For example, the command to modify the location of color, etc.
?
?
/etc/shells shells
Storage location: And you can switch the shell

?
?
?
/etc/motd
Prompt content after login
?
?
?
/etc/issue
Tips before landing
These are both landing tips.
If you want to make changes. Please use root permissions
Issue option Description
\d: Insert the current date;
\s: Insert system name;
\l: Insert the name of the current terminal login;
\M: Insert the computer's architecture identifier, for example, i486, i386, x86_64;
\ n: Insert the machine's node (hostname);
\o: NIS domain name for the machine
\o: DNS domain name of the computer;
\ r: Operating system kernel version number (UNAME-R)
\ t: Insert the current time;
\u: Insert the number of current user login;
?
?
?

/etc/localtime
Time zone needs to be run with Zdump
?
?
?

/etc/bashrc
Set Alias: But set it in here. will be a global alias. Try not to use it. To write an alias, please use the ~/.BASHRC under your home directory.

?
?
?

/etc/hosts
Host name and IP configuration file
This file can be configured with the host IP and its corresponding host name, and the role of the server type Linux system is not negligible.
On a local area network or on the Internet, each host is represented by an IP address, which differentiates each host and can communicate based on IP. But the IP address is not easy to remember, all have a domain name. In a local area network, each machine has a host name, which is used to differentiate the host and facilitate mutual access.

/ETC/SYSCONFIG/NETWORK-SCRIPT/IFCFG-ETHX (X For example, Centos7 is 33)
About the network configuration of Linux
Device=eth0 #网卡设备名称
Onboot=yes #启动时是否激活 Yes | No
Bootproto=static #协议类型 DHCP BOOTP None
ipaddr=192.168.1.90 #网络IP地址
netmask=255.255.255.0 #网络子网地址
gateway=192.168.1.1 #网关地址
broadcast=192.168.1.255 #广播地址
hwaddr=00:0c:29:fe:1a:09 #网卡MAC地址
Type=ethernet #网卡类型为以太网
Onboot= "Yes" activates the network

The network adapter needs to be restarted after the settings have been modified
Service Network restart

?
?

/etc/passwd
Root:x:0:0:root:/root:/bin/bash
Bin:x:1:1:bin:/bin:/sbin/nologin
Daemon:x:2:2:daemon:/sbin:/sbin/nologin
1. Account Name
2, the password
3, Uid,root user is 0 Centos7 inside the ordinary user is starting from 1000
4. GID, i.e. group ID
5, about the account of some descriptive information such as home address and so on.
6, the home directory of the account
7. Shell used by account
8. If the account is not logged in now, it will show Nologin

?
?

/etc/shadow
Store user's information
root:$6$cmud2biknwebxdl8$euqiqdnohaywctakxnvalv7np6hhqwfdgty8ribjncj83q184nmdhmmkijcppkdlw9nkbkhkb.1hfxfoy3v66 /::0:99999:7:::
Bin::17632:0:99999:7:::
Daemon
:: 17632:0:99999:7:::
1. Account Name
2, plus password
3. Date of recent password change.
4, password can not be changed days: Set this value, that is, from the date of change password, how many days can not change the password, if it is 0, there is no limit
5. The number of days the password needs to be re-changed: Force the user to change the password, if 99999 there is no limit
6, Password expiration warning days: If you set a password to change the number of days such as 7, the password expires in the first 7 days of the reminder, prompting the user whose password will expire after 7 days
7. More than x days to expire password
8. Maximum period of use of the account

About the password of the $6$xxxxx Baidu came
If empty, the corresponding user does not have a password, login without password;
The asterisk indicates that the account is locked;
A double exclamation mark indicates that the password has expired;
$6$, which indicates that it is encrypted with SHA-512;
$1$ indicates that it is encrypted with MD5;
$2$ is encrypted with blowfish;
$5$ is encrypted with SHA-256;
!! It means locking.
?
?

/var/log/dmesg
Contains the kernel buffer carefully
Many hardware-related information is displayed on the screen at system startup
You can use the DMESG command to see them.
?
?

/etc/default/useradd
Inside content
Useradd defaults file
group=100
Home=/home the newly created user home directory where to put it. Let the People
Inactive=-1 account password expires after how long the lock is not locked by default
expire= Password Expiration date
Shell=/bin/bash
Skel=/etc/skel newly created the most original home directory content in here can be seen as a new home directory template
Create_mail_spool=yes

?
?
?
/etc/skel
The directory where new user profiles are stored, and when we add new users, all files in this directory are automatically copied to the newly added user's home directory.
?
?
?

/etc/login.defs
Store some encrypted information, etc.
Where for example
Pass_max_days the validity period of the password (if the new user is changed after the change, the validity period is calculated. Default)
Set the upper and lower limits of the UID

?
?
?
/etc/group
Set the name of the password and other storage location
TOMCATT:X: 1006:xxxxxxx
Group name password group number followed by a group member
?
?
?

Cat/etc/gshadow
Same as user name: There are also two of groups:

The role of Linux directories and related files (confusing edition) for beginners

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.