![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux
marcellen
这个作者很懒,什么都没留下…
展开
-
Linux设置开机启动
查看开机启动项# CentOS6chkconfig --listchkconfig sshd --list# CentOS7systemctl list-unit-filessystemctl list-unit-files|grep sshd.service开启关闭服务# CentOS6# 启动/关闭/重启/显示一个服务service telnet start/stop/restart/status# CentOS7# 启动/关闭/重启/显示一个服务systemctl st原创 2021-08-19 16:05:03 · 204 阅读 · 1 评论 -
makefile简介
1. 规则格式:target: depends<tab>command2. 伪目标关键字.PHONY表示它后面的目标都是伪目标格式:.PHONY: target1 targe23. 变量自定义变量格式:变量名 := 值引用:$(变量名)自动变量在使用时,自动替换特定的值自动变量有$@ 当前规则的目标文件$^ 当前规则的所有依赖文件$< 当前规则的第一个依赖文件$? 规则中日期比目标文件新的所有依赖文件(逗号隔开)$(@D)原创 2021-08-19 15:57:52 · 78 阅读 · 0 评论 -
CentOS7防火墙常用操作
1. 防火墙服务# 查看防火墙状态firewall-cmd --state# 开启防火墙systemctl start firewalld.service# 停止systemctl stop firewalld.service# 重启systemctl restart firewalld.service# 开启启动systemctl enable firewalld.service# 禁止firewall开机启动systemctl disable firewalld.service原创 2021-04-14 11:09:37 · 106 阅读 · 0 评论 -
Linux常用压缩与解压缩
.zipzip all.zip *.jpgunzip all.zip.tar.gz/.tgz# 不解压预览gzip -dc file.tar.gz | tar tvf -# 压缩tar -zxvf .tar.gz# 解压缩tar zcvf FileName.tar.gz DirNametar zxf FileName.tar.gz -C Path #解压到指定 (已存在) 目录.tar# tar是打包,不是压缩# 不解压预览tar tvf file.tar# 打包原创 2021-04-14 11:07:07 · 191 阅读 · 0 评论 -
rpm和yum
rpm命令1. 查询(一)查询系统装已经安装的软件信息1)查询系统中已经安装的软件rpm -qa 软件名2)查询一个已经安装的文件属于哪个软件包;rpm -qf 文件名的绝对路径3)查询已安装软件包都安装到何处;软件名定义是:rpm包去除平台信息和后缀后的信息rpm -ql 软件名4)查询一个已安装软件包的信息rpm -qi 软件名5)查看一下已安装软件的配置文件;rpm -qc 软件名6)查原创 2017-04-11 13:15:40 · 281 阅读 · 0 评论 -
Linux下获取cpu数量
1. 通过shell获取cpu相关1.1 查看CPU详细信息cat /proc/cpuinfo这个命令可以看到cpu每个核的信息 1.2 查看CPU信息lscpu1.3 查看进程在哪个CPU上运行ps -eo pid,args,psr | grep xxx# pid - 进程ID# args - 该进程执行时传入的命令行参数# psr - 分配给进程的CPU2. 通过C程序编程获取两个API原创 2017-12-13 17:11:30 · 6483 阅读 · 0 评论 -
Linux防火墙配置
首先,Linux防火墙配置文件:/etc/sysconfig/iptables样例# 打开22端口iptables -A INPUT -p tcp --dport 22 -j ACCEPTiptables -A OUTPUT -p tcp --sport 22 -j ACCEPT# 打开DNS服务端口iptables -A INPUT -p udp --dport 53 -j ACCEPT命原创 2017-12-13 17:20:58 · 4823 阅读 · 0 评论