Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

RedHat 25th online training course-lesson 5

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Knowledge Points:

vim editor:

Three modes: command mode, input mode and last line mode;

Command mode: control cursor movement, text copy, paste and find work;

Input mode: normal input mode;

Last Line Mode: Save or exit the document.

Command in Command Mode

dd: delete (cut) the entire row where the cursor is located;

5dd: delete (cut) the 5 lines starting from the cursor;

yy: copy the entire row where the cursor is located;

5yy: copy the 5 lines starting at the cursor;

n: Display the next string located by the search

p: Paste the previously deleted dd or copied yy data to the back of the cursor;

u: Cancel the previous operation;

N: Display the last character located by search

Command in last line mode:

:w Save

:q Exit

:q! Force exit (discard changes to the document)

:wq! Forced Save Exit

:set nu Display line numbers

:set nonu Do not display line numbers

: Command Execute the command

: integer Jump to line

:s/one/two Replace the first one of the row with two

:s/one/two/g Replace all ones with two in the row where the current cursor is located

:%s/one/two/g Replace all ones with two throughout the text

? String Search text for this string from bottom to top

/String Search text for this string from top to bottom

Examples:

Configure Host Name:

vim /etc/hostname

Configure network card information:

vim /etc/sysconfig/network-scripts/ifcfg-eno*****

Configure yum software repository

vim /etc/yum.repos.d/rhel7.repo

Writing shell scripts:

#!/ bin/bash #! Tells the system that the program specified by its path is the Shell program that interprets the script file.

#comments ....

pwd

ls -al

$0 Script Name

$#: n parameters received;

$1, $3, $5: 1st, 3rd, 5th parameters;

Format of test statement: [space-conditional expression-space]

- whether d is a catalogue;

-e Whether the file exists

-f is a general document

-r Does the current user have permission to read?

-w Does it have permission to write

-x Does the user have permission to execute

Is-eq equal to

Is-ne not equal to

-gt Is it greater than

-lt is less than

-le is less than or equal to ''

-ge is greater than or equal to

if conditional test statement: if conditional expression then elif conditional expression then else judgment fifor variable name in list do repeated command donewhile conditional test do repeated command list donecase variable value in mode 1) command sequence 1 mode 2) command sequence 2;*) default command sequence esac

Planned mission:

Second, personal experience:

This chapter is very critical, is the focus and core, one point to review, must learn;

III. Photographs

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report