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

What are the common commands for building CentOS7 servers

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Today, I will introduce to you what are the common commands for building CentOS7 servers. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

Although Linux commands are powerful and easy to use, it is not easy for a person who does not specialize in Linux maintenance to remember many complex commands. Some commonly used commands are recorded here for easy reference.

Switch user su-myuser

View the hidden file ls-a

Find the file find-name / mypath

Check port occupancy netstat-anp | grep 1234

View the process ps-aux | grep abcd

Terminate the process kill-9 123456

View the current directory size du-lh-- max-depth=1

User actions / / limit user test cannot telnet, only ftpusermod-s / sbin/nologin foo// can change the home directory of user foo to / data/foousermod-d / data/foo foo// change / data/foo directory owner and group is foochown foo:foo / data/foo service management tool

Detailed explanation of systemctl command in CentOS7: https://github.com/xiayulei/notebook/issues/33

Start a service: systemctl start postfix.service

Shut down a service: systemctl stop postfix.service

Restart a service: systemctl restart postfix.service

Displays the status of a service: systemctl status postfix.service

Enable a service at boot time: systemctl enable postfix.service

Disable one service at boot time: systemctl disable postfix.service

Check to see if the service is powered on: systemctl is-enabled postfix.service

View the list of started services: systemctl list-unit-files | grep enabled

View the list of services that failed to start: systemctl-failed

Data migration between servers # Export MySQL database yum install openssh-clients from source server / / install ssh client mysqldump-umyname-p mydb > file.sql / / Export database tar-czvf file.tar.gz file.sql / / zip file scp-P22 file.sql myname@111.222 .333.444: / home/myname / / transfer files. -P is the port number. Default is 2. Import MySQL database mysql-umyname-p / login database use mydb; / / switch database source / home/myname/file.sql; / / import database exit to the target server / / exit the database tar-xzvf file.tar.gz / / extract the files above are all the common commands set up by the CentOS7 server You can search the previous articles or browse the following articles to learn more about the common commands built with the CentOS7 server. I believe the editor will add more knowledge to you. I hope you can support it!

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

Development

Wechat

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

12
Report