Linux常用命令
in 服务器 with 0 comment 36 views

Linux常用命令

in 服务器 with 0 comment 36 views

个人常用命令记录

防火墙

systemctl status firewalld
systemctl start firewalld
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

端口

netstat -ntulp |grep 80

进程

ps aux | grep java
ps aux|head -1;ps aux|grep -v PID|sort -rn -k +3|head
ps aux|head -1;ps aux|grep -v PID|sort -rn -k +4|head

系统

cat /proc/cpuinfo |grep "physical id"|sort|uniq|wc -l
cat /proc/cpuinfo |grep "cpu cores"|uniq|wc -l
cat /proc/cpuinfo |grep "processor"|wc -l

mongodb

./mongo host:port/database -u "user" -p "password"

ssh远程执行命令(密钥登录)

ssh -i /home/ubuntu/vision.pem -o "StrictHostKeyChecking no" ubuntu@127.0.0.1 "sudo su examinee -c 'vncserver -localhost no :1'"

ubuntu桌面(gnome)

查看桌面壁纸

gsettings get org.gnome.desktop.background picture-uri

设置桌面壁纸

gsettings set org.gnome.desktop.background picture-uri file:////usr/share/backgrounds/matt-mcnulty-nyc-2nd-ave.jpg
Responses