Linux common commands (basic)

Start nginx nginx -s reload

Shutdown -h now halt init 0

Shutdown -r now reboot init 6

Log out user: logout Ctrl + d

View IP address ifconfig

Compression command tar -zcvf compressed file name. tar.gz compressed file name

Track and view the error log tail -f file name

View process ps aux | grep mysql

View port netstat -tlunp | grep :3306

Create wwwroot (web root directory) mkdir /wwwroot

View the open ports of this machine netstat -tlunp

Test Nginx nginx -t

Restart Nginx nginx -s reload

Stop Nginx nginx -s stop

Restart PHP first ps aux | grep php-fpm //Find the master PID

After restarting PHP, kill -USR2 PID //Restart

Stop PHP kill -QUIT PID // stop

Login mysql mysql -uusername -p

Show databases

View mysql user information select user, host from mysql.user

Add mysql user grant all privileges on test.* to

‘ln1812’@‘192.168.91.%’ identified by ‘123456abc’;

Delete from mysql.user where user='xxxx' and host=''

Update mysql.user set
authentication_string=PASSWORD('xxxxx') where user='zhangsan';

View MySQL configuration information show variables like “%log_bin%”;

View table creation statement (DDL) show create table tb_name;

View MySQL thread show processlist

Kill a thread kill 100

Execute system command system xxx

Display the current database select database()

Database backup: mysqldump mysqldump -uroot -pxxxx db_name> xxx.sql

Export the entire database command: mysqldump -u username -p database name> exported file name

Import data: use db_name; source xxx.sql

Show master status\G

Show slave status show slave status\G

Stop slave

Start slave

Check the network: ping www.abc.com ping 192.68.xx

File share mapping Samba service smbd stop service smbd start

Completing the laravel framework composer install

git commit error to restore the previous version git reset --hard version number to be restored

Guess you like

Origin blog.csdn.net/weixin_44900765/article/details/106278153