当前位置:网站首页>Rhcsa day 9
Rhcsa day 9
2022-07-04 10:17:00 【Attiude】
Just signed in Linux when , First start /etc/profile
file , Then start... In the user directory ~/.bash_profile
、~/.bash_login
or ~/.profile
One of the documents
Order of execution by :~/.bash_profile
、~/.bash_login
、 ~/.profile
.
If ~/.bash_profile
If the document exists , In general, it will also carry out ~/.bashrc
file .
/etc/profile >>>> Of all users
.bash_profile>>>> Current user
/etc/.bashrc>>>> Home catalog
User's environment variable configuration :
[[email protected] ~]$ ls /root/.bashrc # It is recommended to set it in this file first
/root/.bashrc
[[email protected] ~]$ ls /root/.bash_profile
/root/.bash_profile
Global environment variable configuration :
[[email protected] ~]$ /etc/profile
[[email protected] ~]$ /etc/bashrc
[[email protected] ~]$ /etc/profile.d/
To initialize or display the loaded content after login , Put the script file in /etc/profile.d/ Then you can ( No need to load execution rights limit )
1. Create a normal variable local_data=1 And access
Create environment variables root_data, Only root Users can access
[[email protected] ~]# vim .bashrc
[[email protected] ~]# echo $root_data
1
Create environment variables normal_user_data, Only ordinary users can access
Create environment variables root Both users and ordinary users can access
2. establish 3 File test1.txt, test2.txt, test3.txt
Use find lookup test1.txt,test2.txt, test3.txt
Use the alias : Name the above command myfind
To take effect automatically every time you log in , Add alias to /etc/profile or ~/.bashrc in . then # source ~/.bashrc . To make every user effective, alias , Add alias to /etc/bashrc Back most , then # source /etc/bashrc
Remove alias
3. View recently used 10 Historical orders
4. Print on one line 123 And from root Switch to normal user
5. Wildcard usage
establish 3 File file1, file2, file3
1.* To match 3 File 2.? matching 3 File
3.[] matching file1 and file3
4.[^] matching file2
5.[!] matching file2
6.{} matching file1 and file3
6. Examples of the use of quotation marks : No quotes , Single quotation marks , Double quotes , The quotation marks ,$()
7.linux Type of user in
linux Type of user group in
Super user's UID——0
System user's UID——1~999
For ordinary users UID——≥1000
linux Which file stores user information in ? And what do the fields mean
User account file ——/etc/passwd passwd It's a text file , Used to define the user account of the system , Because all users are right passwd Have the right to read , So this file Only user accounts are defined in , Without saving the password .
passwd In file : Each line defines a user account Field meaning Login name Login name Encryption port Make Use SHA-512/SHA-256/MD5 The password encrypted by the algorithm ,
If it is empty , Indicates that the user can log in without a password ,
if “*” Indicates that the account cannot be used to log in to the system
if “!!” Indicates that the account password has been locked Finally Time modification Time Date of last password change , With distance 1970 year 1 month 1 The number of days in a day means At the very least Interval How many days can the password not be changed . The default value is 0, Means unrestricted Maximum time Interval How many days must the password be changed . The default value is 99999, It means that there is no restriction When warning between How many days in advance to warn users that the password will expire , The default value is 7 God ,0 Indicates that no warning is provided inactive Time How many days after the password expires, disable this user When the failure between Password expiration date , With distance 1970 year 1 month 1 The number of days in a day means , The default is empty. , Indicates permanently available sign Keep unused ,
For future development Each line by 7 Fields make up , Use... Between fields “:” Separate , The format is as follows :
Account name : password :UID:GID: The personal data : Home directory :Shell Field description :
Account name : The user login Linux The name of the system .
password : Previously, the location of the password was saved in an encrypted format , Now the password is saved in /etc/shadow In file , This is just a password placeholder “x” or “*”. if “x”, It means that the password has passed shadow The protection of the
UID: User's identity , It's a number , Use it to distinguish different users
GID: Identification of the basic group in which the user belongs , It's a number , Use it to distinguish different groups , The same group has the same GID.
The personal data : You can record the full name of the user 、 Address 、 Office phone 、 Personal information such as home phone .
Home directory : similar Windows Personal directory , Usually /home/username, here username Is the user name , User execution “cd~” Command, the current directory will switch to the personal home directory .
Shell: Define the number of users to activate after logging in Shell, The default is Bash Shell
linux What is the file in which the group information is stored ? And what do the fields mean ?
User group account file ——/etc/group Every file in the system has a user and a group owner .
Use “ls –l” The command can see the owner and group of each file .
Each group in the system , stay /etc/group There is a line in the file Any user can read the user group account information profile . The real password of the user group is saved in /etc/gshadow In profile .
边栏推荐
- 入职中国平安三周年的一些总结
- Latex arranges single column table pictures in double column format articles
- libmysqlclient.so.20: cannot open shared object file: No such file or directory
- Reasons and solutions for the 8-hour difference in mongodb data date display
- Golang type comparison
- Service developers publish services based on EDAs
- The time difference between the past time and the present time of uniapp processing, such as just, a few minutes ago, a few hours ago, a few months ago
- Latex learning insertion number - list of filled dots, bars, numbers
- 转载:等比数列的求和公式,及其推导过程
- Exercise 9-5 address book sorting (20 points)
猜你喜欢
智慧路灯杆水库区安全监测应用
Tables in the thesis of latex learning
Hands on deep learning (43) -- machine translation and its data construction
Advanced technology management - how to design and follow up the performance of students at different levels
leetcode1-3
百度研发三面惨遭滑铁卢:面试官一套组合拳让我当场懵逼
Hands on deep learning (40) -- short and long term memory network (LSTM)
C language pointer classic interview question - the first bullet
Latex learning insertion number - list of filled dots, bars, numbers
SQL replying to comments
随机推荐
Summary of reasons for web side automation test failure
Hands on deep learning (46) -- attention mechanism
leetcode1-3
Hands on deep learning (33) -- style transfer
MySQL develops small mall management system
【Day2】 convolutional-neural-networks
按键精灵打怪学习-识别所在地图、跑图、进入帮派识别NPC
Fabric of kubernetes CNI plug-in
[FAQ] summary of common causes and solutions of Huawei account service error 907135701
Ruby time format conversion strftime MS matching format
Kotlin set operation summary
Mmclassification annotation file generation
基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 2
[200 opencv routines] 218 Multi line italic text watermark
Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 1
Differences among opencv versions
华为联机对战如何提升玩家匹配成功几率
Es entry series - 6 document relevance and sorting
Vs201 solution to failure to open source file HPP (or link library file)
Golang Modules