Create Folder "MkDir"
One, mkdir command use permissions
All users can create folders or directories in a folder that has permissions by using the mkdir command at the terminal.
Second, the mkdir command uses the format
Format: mkdir [options] DirName
Three, mkdir command function
The mkdir command enables you to create a folder or directory that is named DirName (the specified file name) at the specified location. Users who want to create a folder or directory must have write access to the parent folder of the folder you are creating (Learn about Linux files-folder permissions click here). Also, the folder (directory) You create cannot have the same name as the filename in its parent directory (that is, the parent folder), that is, the same directory cannot have the same name (case sensitive).
Iv. description of mkdir command options
The [options] in the command generally have the following two kinds:
-M is used to set access permissions on the new directory, or it can be set with the chmod command.
-P creates a top-level folder (or directory) when needed, and is not considered an error if the folder (or directory) already exists.
Delete Folder "rm"
One, RM command use permissions
All users can delete the directory at the terminal using the RM command.
RM Command Use Format
Format: RM [Options] DirName
Three, RM command function
Delete files and directories.
Iv. Description of RM command options
The options in the command generally have the following types:
-I ask for confirmation before deleting.
-F Even if the original file attribute is set to read-only, it is deleted directly without confirmation.
-R the directory and the following files are also deleted.
Example of using RM command
Example one: Delete all C language Program documents, ask for confirmation before deleting.
Rm-i *.c
Example two: Delete all the files in the finished subdirectory and subdirectories.
Rm-r finished
Note: There is no Recycle Bin in Linux, you must be careful when you try the RM command, you can no longer recover it after you delete it.
Create File "VI"
First, the order to enter VI
VI FileName: Opens or creates a new file and places the cursor at the beginning of the first
VI +n FileName: Opens the file and places the cursor at the beginning of nth
VI + FileName: Opens the file and places the cursor at the beginning of the last line
VI +/pattern FileName: Opens the file and places the cursor at the first string that matches the pattern
Vi-r FileName: The last time you were editing with VI, a system crash occurred, restoring filename
VI filename....filename: Open multiple files, edit them sequentially
Second, move the cursor class command
H: Move the cursor one character to the left
L: Move the cursor right one character
Space: Move the cursor right one character
Backspace: Cursor moves left one character
K or ctrl+p: Move the cursor up one line
J or CTRL + N: Move the cursor down one line
Enter: Move the cursor down one line
W or W: Move the cursor right one word to the beginning of the word
B or B: The cursor moves left one word to the beginning of the word
E or E: Move the cursor right one word to the end of the word
): Move the cursor to the end of the sentence
(: The cursor moves to the beginning of the sentence
}: Move the cursor to the beginning of the paragraph
{: Cursor moves to end of paragraph
NG: Cursor moves to the beginning of nth
n+: The cursor moves down n rows
N: Move the cursor up n rows
n$: Cursor moves to end of Nth line
H: Move the cursor to the top row of the screen
M: Move the cursor to the middle line of the screen
L: The cursor moves to the last line of the screen
0: (note is the number 0) cursor moves to the beginning of the current line
$: Cursor moves to the end of the current line
Three, screen tumbling Class command
Ctrl+u: First half screen to file
Ctrl+d: Half-screen to the end of the file
CTRL+F: Flip a screen to the end of a file
ctrl+b; Turn one screen to the top of the file
NZ: Rolls line N to the top of the screen and scrolls the current line to the top of the screen when n is not specified.
Iv. inserting text class commands
I: Before the cursor
I: At the beginning of the current
A: After the cursor
A: At the end of the current line
O: A new line below the current line
O: New row above the current line
R: Replace the current character
R: Replaces the current character and its characters until the ESC key is pressed
S: replaces the specified number of characters with the input text starting at the current cursor position
S: Deletes the specified number of rows and replaces them with the input text
NCW or NCW: Modifies a specified number of words
NCC: Modifying a specified number of rows
V. Delete command
NDW or NDW: Delete the n-1 characters at the beginning and after the cursor
Do: Delete to the beginning of the line
d$: Delete to end of line
NDD: Deletes the current line and its subsequent n-1 rows
X or x: Deletes a character, x deletes the cursor, and x deletes the cursor before the
Ctrl+u: Delete text entered under input mode
Vi. Search and Replace commands
/pattern: Searches for pattern at the end of the file from the beginning of the cursor
? pattern: Searches for pattern from the beginning of the cursor to the top of the file
N: Repeat the last search command in the same direction
N: Repeats the last search command in the opposite direction
: s/p1/p2/g: Replaces all P1 in the current row with P2
: n1,n2s/p1/p2/g: All P1 in line N1 to N2 are replaced with P2
: g/p1/s//p2/g: Replace all P1 in the file with P2
Linux Operations folder