First, replace the file
1. Op.txt is known to exist in the/root/data, how to copy the/root/afeng/op.txt to the data directory and replace
2.1[[email protected]/]# \cp/root/afeng/op.txt/root/data/
2.2[[email protected] ~]#/bin/cp/root/data/op.txt/root/afeng/
Second, VIM's shortcut keys
G reach the bottom
GG arrives on the first floor
O Go to the downstream editor
U undo
: Wq Save and exit
: q! Forced exit
Third, set the alias
1. Why alias is set
Safety: To enter a crowbar when using dangerous commands
2. The first step
[[email protected] ~]# alias MN
-bash:alias:mn:not found
3.[[email protected] ~]# alias mn= ' Command (example: Echo mn Lada) '
[[email protected] ~]# alias mn= ' echo mn Lada '
[Email protected] ~]# MN
MN Lada
4. Step Two
[Email protected] ~]# Vim/etc/profile
Press GG to the lowest level
Press O to go to the next line to edit
Press ESC to exit edit mode, enter save to exit
5. Entry into force, inspection
Check:
Iv. Replacement of file contents
1. Command find+ pipe +sed
[Email protected] ~]# find/data/-type f-name ' *.txt ' |xargs sed-i ' s#hs#wbd#g '
V. Basic Linux optimization
1. Display System version information
[Email protected] ~]# cat/etc/redhat-release
[Email protected] ~]# uname-r
[Email protected] ~]# uname-m
2. Add user set password switch user
Add User: Useradd Oldboy
Password Setting a password
[email protected] ~] #passwd Oldboy
New Password:
Retype new Password: (Input two times)
Show Passwd:all authentication tokens updated successfully. And for success
3. Switch users:
Su-oldboy
CTRL + D (exiting the current user)
Linux operations sixth----Linux commands and Linux Essentials optimization