Linux工作中常用命令


常用命令

date -s "20190101 15:15:15"  		##修改系统时间
find /servyou/domains -name nohup.out |xargs grep -rn "*" --color	
less			##根据某字段查询上下文					
ps aux 								##查看进程
kill -9 进程号						#杀掉进程	
lsof -i:prot						##查看端口对应的进程
ps -ef|grep ***						##查看***相关进程
ps -ef | grep leavay | awk '{print $2}' | xargs kill -9     ##查找进程的同时杀掉进程
wget ip:port(连接下载)				##测试IP和端口是否能访问
telnet IP port						##测试IP的端口是否能连通
du -sh *							##查看当前目录占用磁盘
df -h 								##查看磁盘空间使用情况
touch ****.txt						##新建文件
chmod -R 777(r表示可读--4,w表示可写--2,x表示可执行--1    ###给文件赋权限,参数-R是递归的意思
tail -n 1000 nohup.out				###显示最后1000行
chage -l username					###查看用户密码过期时间等信息

source命令通常用于重新执行刚修改的初始化文件,使之立即生效,而不必注销并重新登录。
用法:source filename 或 . filename

1:查看防火状态
systemctl status firewalld
service  iptables status
2:暂时关闭防火墙
systemctl stop firewalld
service  iptables stop
3:永久关闭防火墙
systemctl disable firewalld
chkconfig iptables off
4:重启防火墙
systemctl enable firewalld
service iptables restart 

 

你可能感兴趣的:(linux,命令,日常工作,linux)