Operation of Linux users and groups, use of VI Editor

Source: Internet
Author: User

Actions for users and groups

Linux systems have unique settings for users, groups, and files that are manipulated
The user corresponds to the group, and the group corresponds to the file being manipulated.
In the latter part of the system, administrator root only needs to care about which group the user belongs to.
No need to care about what files the user specifically operates

Three modes: command (Default), edit (Add and modify), last line (exit)

VI Editor
1. Enter edit mode
A: Move the cursor backward one
I: the cursor and the same character do not change
O: New Line
S: Delete the character of the cursor
2, the operation of the tail line mode
Q//Exit Editor
w//Save the modified content
WQ//Save changes and exit the editor
Q! Force exit editor (not saved)
W! Force Save
wq! Force Save and exit edit
Set number or Nu//Setting line numbers
:/content/or:/content//search for specified content
N (Next)
N (prev)
: Numbers//jumps to numbers in the row
String substitution cont1 is replaced with Cont2
: s/cont1/cont2///Replace the first cont1 of the row in which the cursor is located (U is undo)
: s/cont1/cont2///Replace all cont1 of the line where the cursor is located
:%s/cont1/cont2/g//Replace entire document with Cont1
3. Command mode operation
1. Cursor movement
1. Cursor movement
Upper (k) (j) Left (h) Right (L) key
2, the word level
W:word move to the first letter of the next word
E: Move to the end letter of the next word
B: Move to the first letter of the last word
3, row-level
$: End of line
0: Beginning of the line
4, paragraph level (flip screen)
{: Previous paragraph header
}: Next (this) paragraph trailing
5. Screen level (no flip screen)
H: Screen Header
L: Screen Tail
6. Document-level
G: Document Trailer
IG: Document Line 1th
NG: Document Nth Line
2. Content deletion
DD: Delete cursor when moving forward
2DD: Delete 2 rows backwards, including the current line
NDD, including the current row, deletes the n-line content backwards
X: Delete the character of the cursor
C+w: Delete from the cursor position to the end of the word
3. Content Replication
YY: The copy cursor is the same as the forward
2yy: Copy the contents of the following 2 lines, including the current line
Nyy, including the current row, copies the contents of the next n rows
P: Paste operations on copied content
4. Related Quick action
U:undo Revocation
J: Merge up and down two lines
R: Single character substitution
.: Repeatedly upload the most recent instructions



Drwxr-xr-x, 2 Haifeng haifeng 4096 September 21 09:38 's Photos
Separate: Master permissions same group user rights other groups user rights file group of owner file
Master: Haifeng to file permissions: R read W write X Execute
Same group of users: Huo to file permissions: R Read W write-
Other group user liming to file permissions: R Read--

Operation of Linux users and groups, use of VI Editor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.