Linux常用命令总结
find命令:
find -type f -name '*.properties'|xargs grep '8093'
find /home -type f -name '*.properties'|xargs grep '8093'
find / -type f -name '*.properties'|xargs grep '8093'
find / -type f -name '*.properties'|xargs grep -rn '8093'
-r 是递归查找
-n 是显示行号
find / -name zkCli.sh
/opt/cloudera/parcels/CDH-5.14.0-1.cdh5.14.0.p0.24/lib/zookeeper/bin/zkCli.sh
grep命令:
linux查找目录下的所有文件中是否含有某个字符串
grep -rn "set" *
标准格式:
grep -r string ./
示例:
grep -r message ./
示例解释:在当前目录下递归查找含有字符串message的文件
更多介绍:
-r 是递归查找
-n 是显示行号
-R 查找所有文件包含子目录
-i 忽略大小写
---xargs配合grep查找
find -type f -name '*.php'|xargs grep 'message'
防火墙命令firewall:
centos7中:
根据提示关闭相应主机的防火墙:
查看防火墙状态:systemctl status firewalld.service
关闭防火墙:systemctl stop firewalld.service
firewall-cmd --zone=public --list-all
开放端口(开放后需要要重启防火墙才生效)
firewall-cmd --zone=public --add-port=8650/tcp --permanent
重启防火墙
firewall-cmd --reload
显示状态: firewall-cmd --state
查看所有打开的端口: firewall-cmd --zone=public --list-ports
添加:
firewall-cmd --zone=public --add-port=80/tcp --permanent
重新载入:
firewall-cmd --reload
查看:
firewall-cmd --zone=public --query-port=80/tcp
删除:
firewall-cmd --zone=public --remove-port=80/tcp --permanent
du命令:
某个目录下所有文件大小
du -sh *
df命令:
df -h
curl命令
(绕过Https验证 -k)
curl -k -H "Content-Type:application/json" -X POST -d '{"client_id":"mytest123","client_secret":"123456","grant_type":"client_credentials","scope":"email"}' 'https://192.168.1.148:9000/xsp-auth/oauth2/token'
curl -H "Content-Type:application/json" -H "Authorization:bearer defg" -X POST -d '{"params":{"sjhm":"13320440081"},"config":{"schema":"false","data":"true"}}' 'http://192.168.1.148:9000/api/res/111/default'
curl -H "Content-Type:application/json" -H "Authorization:bearer defg" -X POST -d '{"params":{"sjhm":"14981198829"},"config":{"schema":"false","data":"true"}}' 'http://192.168.1.148:9000/api/res/112/default'
curl -H "Content-Type:application/json" -H "Authorization:bearer defg" -X POST -d '{"params":{"idCard":"532331199605052645"},"config":{"schema":"true","data":"true"}}' 'http://192.168.1.148:9000/api/res/113/default'
curl -H "Content-Type:application/json" -H "Authorization:bearer defg" -X POST -d '{"params":{"idCard":"532331199605052645"},"config":{"schema":"true","data":"true"}}' 'http://192.168.1.148:9000/api/res/114/default'
curl -H "Content-Type:application/json" -H "Authorization:bearer defg" -X POST -d '{"params":{"idCard":"532331199605052645"},"config":{"schema":"true","data":"true"}}' 'http://192.168.1.148:9000/api/res/115/default'
curl -H "Content-Type:application/json" -H "Authorization:bearer defg" -X POST -d '{"params":{"idCard":"530421200301090024"},"config":{"schema":"true","data":"true"}}' 'http://192.168.1.148:9000/api/res/116/default'
curl -H "Content-Type:application/json" -X POST -d '{"client_id":"mytest123","client_secret":"efgh","grant_type":"client_credentials","scope":"email"}' 'http://192.168.1.148:9000/api/res/117/default'
curl-X POST -H 'Accept: application/json' -H 'Content-Type:application/json' "http://x.x.x.x:8088/ws/v1/cluster/apps" -d '@shell.json'
shell.json内容如下:
{
"am-container-spec": { "commands": {
"command": "echo xxxxx"
}
},
"application-id":"application_xxxxxxxx", "application-name":"test_it",
"application-type":"YARN"
}
相关推荐
linux详细命令总结 linux详细命令总结 linux详细命令总结 linux详细命令总结 linux详细命令总结 linux详细命令总结 linux详细命令总结 超级详细
linux 常用命令总结
### Linux常用命令总结知识点 #### 一、命令格式与系统运行级别 - **命令格式**: - **标准格式**:`命令[-选项][参数]` - **示例**:`ls –la /etc` - 在某些情况下,特定命令可能不遵循此格式。 - 多个选项...
Linux常用命令总结(入门篇)的知识点主要包括以下内容: 1. 命令的快捷键操作技巧: - 使用Ctrl+shift+F1-F6可进入字符界面,Ctrl+shift+F7回到桌面。 - 键盘上下方向键可用于查找之前的命令历史。 - Tab键用于...