In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you what the commonly used linux instructions are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Linux common operation instructions
1. Text operation
% s / replace string object / replace target string
% s/aaa/sss replaces all aaa in the text with sss
/ find string
/ 123 find 123 in the text (n next N last one)
A starts inserting one bit after the cursor
An insert at the end of the line
I insert at the front of the row
Gg jumps directly to the first line of the file
G jumps directly to the last line of the file
Dd deletes lines, or if 5dd deletes 5 lines after the cursor at once
If yy copies the current line and multiple lines, 3yy copies 3 lines near the current line
P sticker
V enters character selection mode. Press y to copy and p to paste when the selection is complete.
Ctrl+v enters the fast selection mode, press y to copy when the selection is complete, and press p to paste
Shift + v enter row selection mode, press y to copy and p to paste when the selection is complete
More filename (space) turn one page under b and turn one page up
Less direction key up one line direction key down the next line
Cat gets all the text (spaces) at once and flips down one line (b) one line down
/ keyword search keyword
Tail-10 xxx.log look at 10 lines
Tail-f xxx.log
Tail-F xxx.log
Normal mode shift + z save exit text twice
First 10 lines of head 10 filename file
2. Backend service
Source / etc/profile / / after configuring the system files, you need to load the configuration once with source
Service View Service instruction (linux Service Control) services.msc (windos Service Control) mspaint (windows Sketchpad)
Service-- status-all / / View all backend running services
Service network start / / Network Card enables network to replace specific services
Service network stop / / Nic shuts down
Restart the service network restart / / network card
3. Firewall 6.0
Chkconfig to view the self-starting configuration of all backend services
Chkconfig iptables off turns off the automatic startup of the specified service. Here the service is iptables Firewall.
Chkconfig iptables on enables the automatic startup of the specified service. Here, the service is iptables Firewall.
4. System startup level management
Vi / etc/inittab
Turn it off together
1 single user
2 nfs shared folders are not supported by multiple users
3 full-function multi-user mode
4 unused is useless
5-x11 graphical interface desktop version
6 restart
5. Compress and decompress related commands
Tar.gz
Compressed tar-cvf myfirsttarball.tar 1.txt 2.txt 3.txt 4.txt
Decompress tar-xvf myfirsttarball.tar
6. Complete the packaging and compression operation at one time
Compress tar-zcvf my.tar.gz / somefile
Decompress tar-zxvf my.tar.gz
-C specifies the directory to which your package is to be unzipped
For example: tar-zxvf my.tar.gz-C / tmp/ is to extract to the tmp directory!
7. What is the meaning of zxvf in the decompression command tar zxvf
X: extract files from the tar package
Z: indicates that the tar package is compressed by gzip, so you need to decompress it with gunzip.
V: show details
F xxx.tar.gz: specifies that the file being processed is xxx.tar.gz
8. Local production of YUM
Install httpd and confirm to install the associated
Yum install-y httpd
List all available package and package groups
Yum list
Be aware of all cached data
Yum clean all
List a package with all dependent packages
Yum deplist httpd
Remove the httpd software
Yum remove httpd
Each file represents a source
Cd / etc/yum.repos.d
File:// local source
Http:// network source
9. View the packages that have been installed by linux
Rpm-qai | grep mysql
-Q query (- Q is to query specific objects such as rpm-Q mysql)
-an all queries all
-I package information
10. View the port
Detailed Analysis of netstat and its conditions
Netstat is used to print the status information of the network system in Linux, so that you can know the network situation of the whole Linux system.
Netstat-nltp
Httpd startup can directly web access port default 80
11. Firewall
Service iptables status
Service iptables start
Service iptables stop
Chkconfig iptables on boot up
Chkconfig iptables off boot does not start
Firewall-cmd-- state # View the default firewall status (show notrunning when turned off and running when turned on)
The above is all the contents of the article "what are the common linux instructions?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Unrar source code installation tutorial, please see attachment
© 2024 shulou.com SLNews company. All rights reserved.