Linux常用命令

jar命令

运行jar包 :java -jar xxx.jar
后台运行jar包 :java -jar xxx.jar &
运行内容重定向输出到x.txt文件中 :nohup java -jar demo.jar >x.txt &
关掉命令窗口依旧运行 :nohup java -jar demo.jar &
切换jdk版本运行: nohup /安装jdk地址/bin/java -jar /项目地址/project.jar >/项目地址/nohup.out 2>&1 &

systemctl命令

重载systemd的配置文件 :systemctl daemon-reload
开机自启动配置添加 :systemctl enable xxx.service
禁用开机自启动 :systemctl disable xxx.service
启动 :systemctl start xxx.service
关闭 :systemctl stop xxx.service
重启 :systemctl restart xxx.service
状态 :systemctl status xxx.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled

防火墙命令

关闭防火墙命令 :systemctl stop firewalld.service
开启防火墙 :systemctl start firewalld.service
开启防火墙 :systemctl status firewalld.service
关闭开机自启动 :systemctl disable firewalld.service
开启开机启动 :systemctl enable firewalld.service
重启防火墙 : firewall-cmd --reload
查看所有打开的端口 :firewall-cmd --list-all --zone=public
添加放行某ip端口规则 :firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="xxx.xxx.xx.x" port protocol="tcp" port="xxxx" accept"
移除放行某ip端口规则:firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="xxx.xxx.xx.x" port protocol="tcp" port="xxxx" accept"

history命令

查看某命令历史 :history | grep xxx
查看历史:history

mysql命令

登录:mysql -u root -p

ps命令

查看指定进程 :ps -ef |grep xxx
查看所有进程:ps -ef

kill命令

杀死某进程 :kill -9 pid
批量杀死进程:pkill -f 进程名

rm命令

强制删除 :rm -rf xxx
普通删除:rm -r xxx

mkdir命令

创建目录 :mkdir xxx
创建多级目录:mkdir -p /xxx/xxx/xxx/xxx

curl命令

发送json格式体:

curl -l -H "Content-type: application/json" -X POST -d '{

"ip": "10.10.10.32",

"username": "admin",

"password": "heyitem@",

"port": 8000

}' http://127.0.0.1:10000/xxx/xxxxx
发送多个查询参数

curl -v -X GET https://xxxx.xxx.com/rest?accessToken=xxxxxxxxx\&appId=xxxxxxxx\&method=xxxxxxxxx\&timestamp=xxxxxxxx

相关推荐
sulikey3 小时前
Linux ext2文件系统结构
linux·操作系统·文件系统·linux文件系统·ext2·ext2文件系统
白菜欣4 小时前
Linux — 进程控制
android·linux·运维
budingxiaomoli4 小时前
Spring IoC &DI
java·spring·ioc·di
Spider Cat 蜘蛛猫4 小时前
Springboot SSO系统设计文档
java·spring boot·后端
皮卡狮4 小时前
Linux开发专属工具
linux
未若君雅裁4 小时前
MySQL高可用与扩展-主从复制读写分离分库分表
java·数据库·mysql
weixin_421725264 小时前
Linux 编程语言全解析:C、C++、Python、Go、Rust 谁更强?
linux·python·go·c·编程语言
学习中.........4 小时前
从扰动函数的变化,感受红黑树带来的性能提升
java
Tolalal5 小时前
Vmware Ubuntu虚拟机扩容
linux·运维·ubuntu
计算机安禾5 小时前
【c++面向对象编程】第24篇:类型转换运算符:自定义隐式转换与explicit
java·c++·算法