原文地址
原文链接
兼容
vi /etc/profile
alias ll = 'ls -l'
alias vim = 'vi'
系统
uname -srm
lsb_release -a
grep -rn "Hello" ./
find | grep Hello
df -hl
du -sh
du -ha -max-depth= 1 *
du -h *
du -s * | sort -nr
ll -hS
ll -hSr
jobs
fg 1
ps -aux
useradd ming
passwd ming
cd -
ping google.com
telnet google.com 1234
nmap -p 1234 google.com
nc google.com 1234
curl google.com:1234
grep --color = auto -r aster *
grep -r 'aster cass' *
which java
lsof -i | grep 10032
lsof -i:1264
ps -ef | grep kushida
kill -s TERM 18627
kill -9 18627
tail -n 20 -f log.ac
echo "export JAVA_HOME=/usr" >> /etc/environment
vim /etc/sysconfig/network-scripts/ifcfg-ens192
Systemctl
systemctl list-unit-files
systemctl enable nginx.service
yum install langpacks-zh_CN.noarch
systemctl reset-failed
systemctl mask test.service
systemctl unmask test.service
systemctl daemon-reload
cd /usr/lib/systemd/system
touch test.service
vim test.service
Mail
yum -y install mailx sendmail
vim /etc/mail.rc
set from = astercass@qq.com
set fron = "AsterCass <astercass@qq.com>"
set smtp = smtp.qq.com
set smtp-auth-user= astercass@qq.com
set smtp-auth-password= somethingjustlikethis
set smtp-auth= login
systemctl stop sendmail.service
systemctl disable sendmail.service
systemctl stop postfix.service
systemctl disable postfix.service
echo "TEST" | mail -v -s "Title" 9527 @qq.com
export LANG = "zh_CN.utf8"
export LC_ALL = "zh_CN.utf8"
echo "Your message" | mail -v -s "Message Subject" -c "9527@qq.com" 9527 @qq.com
SSh
vim /etc/ssh/sshd_config
Port 9527
systemctl restart sshd.service
/usr/sbin/sestatus -v
semanage port -l | grep ssh
semanage port -a -t ssh_port_t -p tcp 9527
sudo
vim /etc/sudoers
Cron
service crond start
service crond stop
service crond restart
service crond reload
service crond status
systemctl enable cron.service
crontab -e
crontab -l
vim /var/log/cron
Mysql
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
systemctl start mysqld.service
systemctl status mysqld.service
grep "password" /var/log/mysqld.log
mysql -uroot -p
vim /etc/my.cnf
systemctl restart mysqld
#修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
#查看当前数据库端口
show global variables like 'port'
#远程访问
use mysql
select user,host from user
update user set host="%" where user="root"
flush privileges;
exit;
原文地址
原文链接