当前位置:网站首页>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 .

边栏推荐
- 浅谈Multus CNI
- Vs201 solution to failure to open source file HPP (or link library file)
- uniapp 小于1000 按原数字显示 超过1000 数字换算成10w+ 1.3k+ 显示
- Latex arranges single column table pictures in double column format articles
- libmysqlclient. so. 20: cannot open shared object file: No such file or directory
- Basic principle of servlet and application of common API methods
- Es advanced series - 1 JVM memory allocation
- Hands on deep learning (42) -- bi-directional recurrent neural network (BI RNN)
- How web pages interact with applets
- Golang Modules
猜你喜欢

Nuxt reports an error: render function or template not defined in component: anonymous

Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 1

Dynamic memory management

Qtreeview+ custom model implementation example

Histogram equalization

【Day2】 convolutional-neural-networks

基于线性函数近似的安全强化学习 Safe RL with Linear Function Approximation 翻译 1

Application of safety monitoring in zhizhilu Denggan reservoir area
What are the advantages of automation?

Hands on deep learning (32) -- fully connected convolutional neural network FCN
随机推荐
Dynamic memory management
转载:等比数列的求和公式,及其推导过程
Basic principle of servlet and application of common API methods
uniapp 处理过去时间对比现在时间的时间差 如刚刚、几分钟前,几小时前,几个月前
【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
Latex arranges single column table pictures in double column format articles
品牌连锁店5G/4G无线组网方案
Es entry series - 6 document relevance and sorting
C # use smtpclient The sendasync method fails to send mail, and always returns canceled
Hands on deep learning (38) -- realize RNN from scratch
什么是 DevSecOps?2022 年的定义、流程、框架和最佳实践
Golang Modules
Latex error: missing delimiter (. Inserted) {\xi \left( {p,{p_q}} \right)} \right|}}
Safety reinforcement learning based on linear function approximation safe RL with linear function approximation translation 2
System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!
直方图均衡化
【Day1】 deep-learning-basics
Laravel文档阅读笔记-How to use @auth and @guest directives in Laravel
leetcode1-3
Button wizard business running learning - commodity quantity, price reminder, judgment Backpack