当前位置:网站首页>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 .
边栏推荐
- System.currentTimeMillis() 和 System.nanoTime() 哪个更快?别用错了!
- Hands on deep learning (37) -- cyclic neural network
- 【Day1】 deep-learning-basics
- Reasons and solutions for the 8-hour difference in mongodb data date display
- leetcode1-3
- Native div has editing ability
- 5g/4g wireless networking scheme for brand chain stores
- 技术管理进阶——如何设计并跟进不同层级同学的绩效
- Realsense of d435i, d435, d415, t265_ Matching and installation of viewer environment
- Vanishing numbers
猜你喜欢
Hands on deep learning (43) -- machine translation and its data construction
基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 2
Kubernetes CNI 插件之Fabric
基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 1
Intelligent gateway helps improve industrial data acquisition and utilization
【Day1】 deep-learning-basics
Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 1
[FAQ] summary of common causes and solutions of Huawei account service error 907135701
libmysqlclient.so.20: cannot open shared object file: No such file or directory
【Day2】 convolutional-neural-networks
随机推荐
uniapp---初步使用websocket(长链接实现)
Latex insert picture, insert formula
Hands on deep learning (32) -- fully connected convolutional neural network FCN
使用 C# 提取 PDF 文件中的所有文字(支持 .NET Core)
Press the button wizard to learn how to fight monsters - identify the map, run the map, enter the gang and identify NPC
5g/4g wireless networking scheme for brand chain stores
【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
Hands on deep learning (41) -- Deep recurrent neural network (deep RNN)
Today's sleep quality record 78 points
Laravel文档阅读笔记-How to use @auth and @guest directives in Laravel
Golang 类型比较
用数据告诉你高考最难的省份是哪里!
leetcode1229. Schedule the meeting
How web pages interact with applets
Use the data to tell you where is the most difficult province for the college entrance examination!
Exercise 7-3 store the numbers in the array in reverse order (20 points)
Hands on deep learning (46) -- attention mechanism
Kotlin 集合操作汇总
Map container
Hands on deep learning (34) -- sequence model