赞
踩
查看svn進程:ps -A | grep svn
殺死進程:kill 進程
啟動svn:cd /usr/local/SVN/ bin/svnserve (目錄)
-d -r /usr/local/svndata/datasvn(啟動命令)
查看tomcat運行日記:tail -f catalina.out -n 2000(查看2000行日記)
編輯:vim server.xml (回車,i,退出編輯:esc,shift+:+wq+enter)
遠程登錄: ssh edi@10.191.38.48
本地複製文件:cp -r
遠程複製文件:scp -r MailUtil.class edi@10.191.38.48:/home/edi/
更改目錄權限:sudo chown -R ediuser.ediuser apache-tomcat-8.0.53/
解壓tomcat.tar.gz文件:tar -xvf apache-tomcat-8.5.41.tar.gz -C /data/
查看linux系統版本:cat /etc/redhat-release
查看系统所有进程数据:ps aux
查看定時任務:crontab -l
新增定時任務:crontab -e
查看运行进程:ps -ef | grep tomcat
查看运行进程:ps -ef | grep nginx
查看samb運行進程:ps -ef | grep smbd | grep -v grep
關nginx進程:sudo kill -quit 29507(進程)
開nginx(進入bin):./nginx
重啟nginx:./nginx -s reload
查看keepalived進程:service keepalived status
keepalived啟動:service keepalived start
keepalived停止:service keepalived stop
查看所有的进程和端口使用情况:netstat –apn
查看端口占用:netstat -anp | grep 8080
用户目录:cd ~
文本编辑器:gedit
文件查找:find /etc -name startup.sh
目录查找:find /etc -name jdk -type d
移动文件:mv filename path
文件重命名:mv hello.txt haha.txt
新建文件:touch hello.txt
删除文件:rm hello.xml -i:有提示 -f:强制删除,无提示
新建文件夹:mkdir hello
删除文件夹:rm -r hello -r:删除文件夹及其文件
拷贝文件:cp hello.xml /opt/temp
文件权限:drwxr-xr-x,第一个字符标示文件类型,后边9个分三组,表属主、同组、其他用户权限
连接显示一个或多个文件信息:cat -n(所有标号) -b(空行不标)
合并文件:cat hello.xml haha.xml > heha.xml
软链接:ln -s /temp temp
查看文件夹大小:du -h --max-depth=0 /lib/jvm
查看文件大小:du -h hello.txt
vi: :wq(保存退出) :w newFile(另存为) :q(不保存退出)
:e!(放弃修改,从上次保存的地方开始)
:wq! 强制保存文件,并退出vi
关闭防火墙:service iptables stop
开启防火墙: service iptables start
查看防火墙状态及端口状态:service iptables status
開啟80端口:vi /etc/sysconfig/iptables 加入如下代碼:-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT 保存後重啟:service iptables start
打开或关闭某个端口,例如:
sudo ufw allow smtp #允许所有的外部IP访问本机的25/tcp (smtp)端口
sudo ufw allow 22/tcp #允许所有的外部IP访问本机的22/tcp (ssh)端口
sudo ufw allow 53 #允许外部访问53端口(tcp/udp)
sudo ufw allow from 192.168.1.100 #允许此IP访问所有的本机端口
sudo ufw allow proto udp 192.168.0.1 port 53 to 192.168.0.2 port 53
sudo ufw deny smtp #禁止外部访问smtp服务
sudo ufw delete allow smtp #删除上面建立的某条规则
查看某個端口使用:sudo lsof -i:8080
防火墻配置:
systemctl status firewalld
systemctl stop firewalld
firewall-cmd --list-ports
sudo firewall-cmd --permanent --zone=public --add-port=8090/tcp
.tar.gz
解压:tar zxvf FileName.tar.gz
压缩:tar zcvf FileName.tar.gz DirName
---------------------------------------------
.zip
解压:unzip FileName.zip
压缩:zip FileName.zip DirName
---------------------------------------------
.rar
解压:rar a FileName.rar
压缩:r ar e FileName.rar
查看内存使用情况:free -m
查看磁盘使用情况:df -m
查看进程内存使用情况:top
杀死进程:kill -9 pid
切换用户到root:sudo su / su root
退回原来用户:exit / Ctrl+d
查看软件是否安装:dpkg -s firefox / dpkg-query -l firefox
dpkg --get-selections | grep firefox
rpm -qa | grep pkgname
rpm -qpl pkgname
查看文件尾部内容:
默认10行:tail filename
显示最新追加的:tail -f catalina.log
SSH連接不上:
1.vi /etc/ssh/ssh_config添加如下內容:
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
2.重啟ssh:sudo service sshd restart
linux 配置多個tomcat
1.配置vi /etc/profile
export TOMCAT_HOME=/usr/local/tomcat
export CATALINA_HOME=/usr/local/tomcat
2.配置tomcat/bin/catalina.sh 文件
export CATALINA_BASE=$CATALINA_2_BASE
export CATALINA_HOME=$CATALINA_2_HOME
Nignx安裝及配置:https://blog.csdn.net/qq_42815754/article/details/82980326
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
nginx:
版本:1.12.2
安装位置:/usr/local/nginx
配置文件:/usr/local/nginx/conf/nginx.conf
启动:/usr/local/nginx/sbin/nginx
重载配置文件:/usr/local/nginx/sbin/nginx -s reload
重启:/usr/local/nginx/sbin/nginx -s reopen
停止:/usr/local/nginx/sbin/nginx -s stop
keepalived:
版本:1.3.7
安装位置:/usr/local/keepalived
配置文件:/etc/keepalived/keepalived.conf
启动:service keepalived start
重启:service keepalived restart
停止:service keepalived stop
nginx脚本文件位置:
/etc/keepalived/check_nginx.sh
添加nginx脚本文件可執行權限:
chmod +x check_nginx.sh
nginx keepalived安装包位置:/usr/local/src
keyStationAppServerMailTrigger.jar包放置位置:/usr/local/src/mailTrigger
統計mysql schema多大:
SELECT
CONCAT(ROUND(SUM(DATA_LENGTH/1024/1024),2),'M') rongliang
FROM information_schema.tables
WHERE table_schema = 'epd_bidding';
samma 命令:
systemctl restart smb
systemctl reload smb
systemctl status smb
linux 启动tomcat 输入startup.sh提示command not found:
sh catalina.sh run
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。