vim practice

1.1 Replication system / etc / services file to the / root directory, and then use the vim command to open the file.
cp / etc / Services / root
vim / etc / Service

1.2 shows the line number of the file
: SET NU
1.3 identifier for each display line of the end of the file
: set list
replacing all "ssh" string into "oldboy" 1.4 replace file
% S Oldboy # # # G SSH
for 1.5 jumping go to line 30 and delete this line.
30gg
Dd
Or: 30d
1.6 revoked once your operation.
U
1.7 when you execute a withdrawal, found undo the wrong, rollback, how to operate.
+ R & lt ctrl
1.8 to line 30, line 25 to first add a comment line, "#". Write Procedure.
ESC
25gg
Ctrl + V
Shift + I
ESC
1.9 delete lines 10 to 20 the first line of the comment row "#". Write Procedure.
V + Ctrl
Alt select 10-20 line
d
when 1.10vim edit files, non-normal exit, and then re-editing a file, an error occurs, how to solve, write the resolution steps.
Enter -r Services vim
RM -f .services.swp
note: first check whether there are other users to edit this file, with w view
1.11 vim configuration file environment variables are what? Which high priority?
The current user's home directory. Vimrc high priority
/ etc / vimrc
1.12 Do you know how to use vim to edit multiple files?
vim -o (horizontal split)
Vim -O (vertical division)

1.13 What command can be different than the two documents, two command What is the difference?
Vimdiff advantages: intuitive highlighting different places
Diff disadvantages: not intuitive

S 1.14 in the normal mode is what role?
Delete cursor line, and enter the edit mode
1.15 What is a user?
Users can log in normally refers to Linux or windows system
1.1616.Linux with the windows system user What is the difference?
Linux support multiple users simultaneously log
windows are not supported by default, but in the case of modifying Group Policy can also multi-user login.
1.17 What command can see if the user exists?
username the above mentioned id
1.18 associated with user profiles are what? What is stored separately?
/ etc / passwd to store user information
/ etc / shadow to store password information for the user
1.19 / etc / passwd file ':' delimiter is divided into seven fields, please explain the specific meaning of each field?
1. login user name
2. Password placeholder
3. Users the UID
4. user group the GID
5. The annotation
6. current user home directory
7. shell user login
1.20 / etc / shadow file ':' as a delimiter, points nine fields, please explain the specific meaning of each field?
1. // user login name of the user account name
2. password encrypted (password is not set to !!)
a recent password change time // 3. From 1970 to the time between the last password change how many days
4. use a minimum password // password least a few days a few days before they can use to change the password (0 for unlimited)
5. Maximum password // password a few days the number of days required to change the password (default 99999 never expires)
6. // warning period before password expiration reminder a few days before the password expires the user to change the password (the default expiration 7 days in advance warning )
7 days remain active after the password expires // within this period, users can still log in and change your password after a specified number of days, the account is locked
8. account expires // since 1970, this account It can be used prior to the date after the expiry.
9. sign // reservations
1.21 What is the user's UID?
User identifier is equivalent to the identity cards
of different users correspond 1.22 UID number range?
User UID system agreed in the meaning of
0 Super Administrator (highest authority)
1-200 users of the system, assigned by the system to system processes
201-999 system user, used to run the service account, no landing system (dynamic allocation)
1000 + regular ordinary users
1.23 new user user1, user2, user2 does not allow the user to log in to the system.
user1 the useradd; the useradd -M -s / sbin / nologin user2
1.24 Create a regular user oldboy, its ID number 789.
the useradd -u 789 Oldboy
1.25 user to create a virtual test, its ID number is 666
the useradd -u 666 -M -s / sbin / nologin
1.26 Oldboy modify user ID, modify 777. the
the usermod -u 777 Oldboy
1.27 test modify the user's command interpreter, so that it can log on to the system.
-s the usermod / bin / bash the Test
1.28 delete user user1. do not delete their home directory.
userl userdel
1.29 delete user user2, do not retain their home directory.
r-user2 userdel
1.30 oldboy user to create a password for the 123, and try to log in.
Passwd
123
123
connected Xshell: [email protected]

Guess you like

Origin www.cnblogs.com/223zhp/p/11546876.html